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

Lists (ordered & unordered) don't use the correct internal Type #36

Open
cimmanon opened this issue Sep 17, 2017 · 1 comment
Open

Lists (ordered & unordered) don't use the correct internal Type #36

cimmanon opened this issue Sep 17, 2017 · 1 comment

Comments

@cimmanon
Copy link

cimmanon commented Sep 17, 2017

I'm attempting to use this library with Heist by passing the results from the markdown function through xmlhtml's renderHtmlNodes.

import Text.Markdown (markdown, defaultMarkdownSettings, msXssProtect)
import Text.Blaze.Renderer.XmlHtml (renderHtmlNodes)

renderHtmlNodes $ markdown defaultMarkdownSettings { msXssProtect = False } "# Title\n\n* one\n* two (*foo*)\n"

The results are pretty close to what I would expect except for one little problem: the opening and closing tags for the unordered list are in a TextNode:

[Element {elementTag = "h1", elementAttrs = [], elementChildren = [TextNode "Title"]}
,TextNode "<ul>"
,Element {elementTag = "li", elementAttrs = [], elementChildren = [TextNode "one"]}
,Element {elementTag = "li", elementAttrs = [], elementChildren =
	[TextNode "two ("
	,Element {elementTag = "i", elementAttrs = [], elementChildren = [TextNode "foo"]}
	,TextNode ")"
	]}
,TextNode "</ul>"
]

The correct output should look like this:

[Element {elementTag = "h1", elementAttrs = [], elementChildren = [TextNode "Title"]}
,Element {elementTag = "ul", elementAttrs = [], elementChildren =
	[Element {elementTag = "li", elementAttrs = [], elementChildren = TextNode "one"]}
	,Element {elementTag = "li", elementAttrs = [], elementChildren =
		[TextNode "two ("
		,Element {elementTag = "i", elementAttrs = [], elementChildren = [TextNode "foo"]}
		,TextNode ")"
		]}
	]}
]

The results are the same for both ordered and unordered lists.

@snoyberg
Copy link
Owner

snoyberg commented Sep 18, 2017 via email

cimmanon added a commit to cimmanon/camellia-splices that referenced this issue Nov 22, 2017
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