Re: HTML entities and Markdown

On 19 November 2012 22:33, Michael C <m@michaelcullum.com> wrote:
> If you have something like `foo & bar`. It should convert it to `foo &amp;
> bar`.

Good catch

In HTML, there are two characters that demand special treatment: < and
&. Left angle brackets are used to start tags; ampersands are used to
denote HTML entities. If you want to use them as literal characters,
you must escape them as entities, e.g. &lt;, and &amp;.


I'll add it to the wiki. Question. Should this extend to url's?




>
> However if you have an HTML entity in your markdown such as: `2 &lt; 6` it
> would not convert the ampersand.
> It would remain as `2 &lt; 6`; not become `2 &amp;lt; 6`.
>
> Things like that seem obvious, but should be specified.

Quite agree! Can you suggest wording to be added to the escaping section?
Or.... Would the baseline be simpler to say that any & character is 'escaped'
and leave it to the implementor / editor?

What do others think?

regards



>
> Thanks,
> Michael Cullum
>
>> -----Original Message-----
>> From: Karl Dubost [mailto:karld@opera.com]
>> Sent: 19 November 2012 22:24
>> To: Michael C
>> Cc: 'Markdown List'
>> Subject: HTML entities and Markdown
>>
>> Michael,
>>
>> Le 20 nov. 2012 à 06:49, Michael C a écrit :
>> > it wouldn't have the scope to cover things like HTML entities.
>>
>> Could you provide an example of Markdown code and its HTML equivalent
>> and what you mean by HTML entities?
>>
>>
>> --
>> Karl Dubost - http://dev.opera.com/
>> Developer Relations, Opera Software
>
>
>



-- 
Dave Pawson
XSLT XSL-FO FAQ.
Docbook FAQ.
http://www.dpawson.co.uk

Received on Tuesday, 20 November 2012 13:09:50 UTC