Skip to content
This repository has been archived by the owner on Feb 28, 2022. It is now read-only.

Single element in markdown not being rendered #157

Closed
koraa opened this issue Jan 14, 2019 · 2 comments
Closed

Single element in markdown not being rendered #157

koraa opened this issue Jan 14, 2019 · 2 comments
Assignees

Comments

@koraa
Copy link
Contributor

koraa commented Jan 14, 2019

Single element inside markdown is not being printed.

# Foo
Foo

This seems to be caused by the markdown parser not generating a surrounding <div> for single element
markdown, which the emit pipeline step expects: document.body.firstChild.childNodes.
We could either 1) make sure we generate the <div> for single element markdowns 2) never generate the div (as most markdown generators do)
and add it later 3) handle that case in emit specifically.

@koraa koraa self-assigned this Jan 14, 2019
@koraa
Copy link
Contributor Author

koraa commented Jan 14, 2019

--Possibly related: #156--

@trieloff
Copy link
Contributor

I'd make emit more robust, so that we can deal with possible Markdown changes that are user-created.

koraa added a commit that referenced this issue Jan 15, 2019
Before this we would wrap multi-element markdowns
with a div and leave single element markdowns as-is.
This caused a bug where the single element markdowns
where discarded (because emit-html though it was just
an empty wrapper div).

Fixes #157, #105
koraa added a commit that referenced this issue Jan 16, 2019
Before this we would wrap multi-element markdowns
with a div and leave single element markdowns as-is.
This caused a bug where the single element markdowns
where discarded (because emit-html though it was just
an empty wrapper div).

Fixes #157
koraa added a commit that referenced this issue Jan 18, 2019
This wrapping div would be added when there was more then one
element in the markdown (which is the usual case) by hyperscript
because hyperscript has no concept of multiple elements in the
root node.

Our code came to expect this wrapping which led to markdowns with
a single element being rendered as an empty document in some
cases (the single element would be deleted during the emit-html
when generating .content.children).

This commit fixes this issue by using hast-util-to-html instead of
hyperscript for the hast -> html conversion which does indeed have
a concept of multiple elements at the root node.

Fixes #157
koraa added a commit that referenced this issue Jan 18, 2019
This wrapping div would be added when there was more then one
element in the markdown (which is the usual case) by hyperscript
because hyperscript has no concept of multiple elements in the
root node.

Our code came to expect this wrapping which led to markdowns with
a single element being rendered as an empty document in some
cases (the single element would be deleted during the emit-html
when generating .content.children).

This commit fixes this issue by using hast-util-to-html instead of
hyperscript for the hast -> html conversion which does indeed have
a concept of multiple elements at the root node.

Fixes #157
koraa added a commit that referenced this issue Jan 18, 2019
This wrapping div would be added when there was more then one
element in the markdown (which is the usual case) by hyperscript
because hyperscript has no concept of multiple elements in the
root node.

Our code came to expect this wrapping which led to markdowns with
a single element being rendered as an empty document in some
cases (the single element would be deleted during the emit-html
when generating .content.children).

This commit fixes this issue by using hast-util-to-html instead of
hyperscript for the hast -> html conversion which does indeed have
a concept of multiple elements at the root node.

Fixes #157
koraa added a commit that referenced this issue Jan 18, 2019
This wrapping div would be added when there was more then one
element in the markdown (which is the usual case) by hyperscript
because hyperscript has no concept of multiple elements in the
root node.

Our code came to expect this wrapping which led to markdowns with
a single element being rendered as an empty document in some
cases (the single element would be deleted during the emit-html
when generating .content.children).

This commit fixes this issue by using hast-util-to-html instead of
hyperscript for the hast -> html conversion which does indeed have
a concept of multiple elements at the root node.

Fixes #157
koraa added a commit that referenced this issue Jan 18, 2019
This wrapping div would be added when there was more then one
element in the markdown (which is the usual case) by hyperscript
because hyperscript has no concept of multiple elements in the
root node.

Our code came to expect this wrapping which led to markdowns with
a single element being rendered as an empty document in some
cases (the single element would be deleted during the emit-html
when generating .content.children).

This commit fixes this issue by using hast-util-to-html instead of
hyperscript for the hast -> html conversion which does indeed have
a concept of multiple elements at the root node.

Fixes #157
koraa added a commit that referenced this issue Jan 18, 2019
This wrapping div would be added when there was more then one
element in the markdown (which is the usual case) by hyperscript
because hyperscript has no concept of multiple elements in the
root node.

Our code came to expect this wrapping which led to markdowns with
a single element being rendered as an empty document in some
cases (the single element would be deleted during the emit-html
when generating .content.children).

This commit fixes this issue by using hast-util-to-html instead of
hyperscript for the hast -> html conversion which does indeed have
a concept of multiple elements at the root node.

Fixes #157
koraa added a commit that referenced this issue Jan 18, 2019
This wrapping div would be added when there was more then one
element in the markdown (which is the usual case) by hyperscript
because hyperscript has no concept of multiple elements in the
root node.

Our code came to expect this wrapping which led to markdowns with
a single element being rendered as an empty document in some
cases (the single element would be deleted during the emit-html
when generating .content.children).

This commit fixes this issue by using hast-util-to-html instead of
hyperscript for the hast -> html conversion which does indeed have
a concept of multiple elements at the root node.

Fixes #157
koraa added a commit that referenced this issue Jan 25, 2019
This wrapping div would be added when there was more then one
element in the markdown (which is the usual case) by hyperscript
because hyperscript has no concept of multiple elements in the
root node.

Our code came to expect this wrapping which led to markdowns with
a single element being rendered as an empty document in some
cases (the single element would be deleted during the emit-html
when generating .content.children).

This commit fixes this issue by using hast-util-to-html instead of
hyperscript for the hast -> html conversion which does indeed have
a concept of multiple elements at the root node.

Fixes #157
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants