New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not all HTML entities are supported #114

Closed
tomer opened this Issue Mar 22, 2014 · 3 comments

Comments

Projects
None yet
3 participants
@tomer

tomer commented Mar 22, 2014

I am using Jekyll with kramdown. While redcrapt supported all the HTML entities I've used, I've found that kramdown doesn't support some of my entities, and instead is just escaping the ampersand character.

I'm using a known and documented entities, which should be supported. I guess that if I'll replace the entity keyword with its numerical location it will work, but it is far less readable for who will read the unparsed document.

test.md

---

---
" Hello World π ‏ & & "

_config.yml

markdown: kramdown

result:

<p>" Hello World π &amp;rlm; &amp; &amp; "</p>

Expected result:

<p>" Hello World π &rlm; &amp; &amp; "</p>

(or replace &rlm with U+200F which I'm not really fan of…)

https://gist.github.com/tomer/9703168

@gettalong gettalong self-assigned this Apr 20, 2014

@gettalong gettalong added the bug label Apr 20, 2014

@gettalong

This comment has been minimized.

Owner

gettalong commented Apr 20, 2014

Thanks for reporting this! I will look through the list and add the missing entities for the next release.

@gettalong gettalong closed this in be644ed Jun 3, 2014

@siman-man

This comment has been minimized.

siman-man commented Jul 5, 2017

I think there are a lot of entities not yet supported.

In these specifications, https://html.spec.whatwg.org/entities.json is referred to

However, ENTITY_TABLE defined in entities.rb doesn't supported many entities compared with that.


For example

require 'kramdown'

text =<<-HTML
&Abreve; &Acy; &Afr; &Amacr; &And;
HTML

puts Kramdown::Document.new(text).to_html

expect

<p>Ă А 𝔄 Ā ⩓</p>

actual

<p>&amp;Abreve; &amp;Acy; &amp;Afr; &amp;Amacr; &amp;And;</p>
@gettalong

This comment has been minimized.

Owner

gettalong commented Sep 8, 2017

@siman-man All HTML4 entity references should be supported. However, I didn't find any W3C HTML5 entity reference table. The WhatWG spec you referenced doesn't seem to be official.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment