0

Markdown to HTML: Inline HTML <link>; '<' to HTML Entity

Lester Lab 8 years ago updated by Alexander Blach (Developer) 7 years ago 3

I like your app!


I'm a new user [Textastic 4.3, iOS 5.1.1, iPod Touch 5th gen].  I'm also a Markdown newbie.


Is it expected behavior that a Markdown file containing a line consisting only of a <link></link> tag, that is separated from the rest of the Markdown text with blank lines, and with no blank spaces preceding the tag, "Generates HTML" with this tag enclosed between <p></p>?  Or is this a bug?


Also, is it unexpected that a '<' character embedded within a Markdown text line is not converted to its HTML entity?


The behavior of the second item affects the output to the Preview.

Can you please send me an example file to support@textasticapp.com?


Textastic uses the Discount Markdown library. It's certainly possible that it has bugs.

Thanks for your response.  I answered my own question.


I traced the Markdown "spec".  Seems Discount and Textastic are doing what they should.


A <link> tag is *not^ an HTML block-level element, because this tag normally appears in the <head> not in the <body>.  And so, it is correct behavior that Discount generates HTML that encapsulates <link></link> within a paragraph as <p><link></link></p>.


Perhaps it might be either a bug or a problem that there is no tight Markdown specification, that the '<' and '>' characters in '<link></link>' are not converted to HTML entities in this case, but maybe that is a desirable feature.


It is a nice trick that you suggested to link to an external CSS stylesheet.  It works well for previewing, even though an external link should appear within the header and not the body, and the HTML can be easily corrected to conform to spec.


Thank you again for bringing this wonderful app to iOS.  It is one of my favorites.