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

<div></div> cannot used in raw HTML #119

Open
Coda-Coda opened this issue Aug 18, 2021 · 4 comments
Open

<div></div> cannot used in raw HTML #119

Coda-Coda opened this issue Aug 18, 2021 · 4 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@Coda-Coda
Copy link

Describe the bug
Placing a <div></div> inside a block using ```{=html} in a emanote markdown file causes the following error:

div cannot contain text looking like its end tag
CallStack (from HasCallStack):
  error, called at src/Text/XmlHtml/HTML/Render.hs:132:9 in xmlhtml-0.2.5.2-CTNpBEzbTM9I9R1TWdgm5i:Text.XmlHtml.HTML.Render

To Reproduce
Steps to reproduce the behavior:

  1. Create the following markdown file
# Demo

Hello World

```{=html}
<div>
Hello World
</div>
\```

(Without the slash, GitHub's markdown makes the slash necessary).

  1. Run emanote

Expected behavior
The page renders two Hello Worlds.

Desktop (please complete the following information):

  • Browser Firefox
  • Version 91

Additional context
The following code in xmlhtml seems to be relevant: https://github.com/snapframework/xmlhtml/blob/master/src/Text/XmlHtml/HTML/Render.hs#L133

This came up because I was trying to follow these instruction for embedding an Argdown component which include <div> tags.

@Coda-Coda Coda-Coda added the bug Something isn't working label Aug 18, 2021
@srid
Copy link
Owner

srid commented Aug 19, 2021

Oddly this happens only for div tag. Any other tag will work. For example this works (no need to wrap in code block either),

<section>
Hello World
</section>

@srid srid changed the title <div></div> cannot be used inside {=html} segment. <div></div> cannot used in raw HTML Aug 19, 2021
@srid
Copy link
Owner

srid commented Aug 19, 2021

I was trying to follow these instruction for embedding an Argdown component

If you manage to get this working with Emanote (try with section or <span class="block"> instead of div), we can add it to the Tips section for the benefit of others (myself included)!

@srid srid added the help wanted Extra attention is needed label Aug 30, 2021
@srid
Copy link
Owner

srid commented Sep 16, 2021

@Coda-Coda Do you have the HTML snippet for activating Argdown on code blocks on the HTML generated by Emanote? I can give it and try and make it work.

I can't figure out just from the Argdown docs as to what the raw embed code should be (it only talks about specific static site generators).

srid referenced this issue in edliaw/edliaw-neuron.github.io Jan 31, 2022
@kukimik
Copy link
Contributor

kukimik commented Jun 28, 2023

Oddly this happens only for div tag. Any other tag will work. For example this works (no need to wrap in code block either),

This happens because the raw html blocks are wrapped in a <div> here: https://github.com/srid/heist-extra/blob/c5e6d869d67637d61aba11f8157c3ff882a5d3df/src/Heist/Extra/Splices/Pandoc/Render.hs#L63.

It was introduced in #43 and the present bug report was expected back then.

#433 is somewhat related.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants