Skip to content
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

markdown: Elixir given code does not follow the specification/given documentation #1455

Closed
Sayrus opened this issue Feb 5, 2019 · 3 comments

Comments

@Sayrus
Copy link

Sayrus commented Feb 5, 2019

The given implementation does not follow the Markdown specification nor does it follows the expected output given in the code comments. The purpose of the exercise is to refactor, after reading #271, I do think this should be fixed.

Header parsing rely on split to get the current header level:

iex(1)> Markdown.parse("#Test")
"<h5></h5>"
iex(2)> Markdown.parse("# Test")
"<h1>Test</h1>"
iex(3)> Markdown.parse("#I_am_a_very_large header")
"<h18>header</h18>"

List doesn't work any better:

iex(1)> Markdown.parse("* Test")
"<ul><li>Test</li></ul>"
iex(2)> Markdown.parse("*Test") 
"<ul><li>*Test</li></ul>"

And the real problem as the others could just be on purpose. According to the comment given in the code:

iex> Markdown.parse("#Header!\n* __Bold Item__\n* _Italic Item_")
"<h1>Header!</h1><ul><li><em>Bold Item</em></li><li><i>Italic Item</i></li></ul>"

Reality when using the ref:

iex(7)> Markdown.parse("#Header!\n* __Bold Item__\n* _Italic Item_")
"<h8></h8><ul><li><strong>Bold Item</strong></li><li><em>Italic Item</em></li></ul>"
@rpottsoh
Copy link
Member

rpottsoh commented Feb 5, 2019

Without performing any deeper investigating, it seems to me that this is an issue for the @exercism/elixir maintainers to look into and should be moved to the Elixer repo.

@Sayrus
Copy link
Author

Sayrus commented Feb 5, 2019

You're right, I missed this repo. I'll wait for an repo admin to move it as I don't want to create a duplicate.

@rpottsoh
Copy link
Member

rpottsoh commented Feb 5, 2019

Issue moved to exercism/elixir #449 via ZenHub

@rpottsoh rpottsoh closed this as completed Feb 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants