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

Two closing br tags in a markdown cell makes notebook disappear #7

Open
miduncan opened this issue Jun 8, 2020 · 3 comments
Open

Comments

@miduncan
Copy link

miduncan commented Jun 8, 2020

Application or Package Used
nteract desktop, nteract web

Describe the bug
Two unclosed html tags in a markdown cell makes notebook disappear

To Reproduce
Steps to reproduce the behavior:

  1. Open nteract desktop
  2. In a new notebook, create a markdown cell
  3. Type "</br></br>"
  4. Click off cell to unfocus
  5. Notebook will disappear

Expected behavior
Either don't show invalid HTML or show as text

Screenshots
After following repro steps, notebooks dissappears like below
image

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser Firefox, Chrome

Additional context
Also works with "</img></img>", seems to be two closing tags of any HTML tag the markdown supports

@miduncan miduncan changed the title Two unclosed html tags in a markdown cell makes notebook disappear Two closing br tags in a markdown cell makes notebook disappear Jun 8, 2020
@petebryan
Copy link

petebryan commented Jun 8, 2020

This issue is not isolated to </br></br> at the end of the cell. Simply having two </br> tags anywhere in a markdown cell causes the same issue. For example:

Print </br>
Print </br>
Print

@ramantehlan
Copy link
Member

ramantehlan commented Jun 9, 2020

Thank you for raising this issue @miduncan and @petebryan for the observation.

I was able to reproduce this issue. From my initial testing, this is what I found.

  • It happens only with HTML tags which don't require closing tags(void elements). Ie. </br>, </img>. Even then it has some exceptions like </hr></hr> doesn't break it, but that doesn't put the function either, so no line is printed.
  • It happens only if you are using / at the start of the tag instead of in the end. So </br> will break it, but <br/> won't.
  • If the cell starts with other tags, it won't break.
// This will not break
<h1> Test </h1>
</br></br>

// This will break
</br></br>
<h1> Test </h1>

@captainsafia, This seems to be an issue in markdown package, we can probably transfer it there.

My initial guess would be that probably the void elements which start with / are not parsed the right way. That will explain why </hr> didn't work and also why <br/><br/> works, but </br></br> doesn't.

@captainsafia
Copy link
Member

Yeah, this should be transferred to the nteract/markdown repo. I'll do that now.

@ramantehlan Your analysis of this seems correct. I'm unable to reproduce this in a standard react-markdown component so I suspect that this error is caused by one of our custom parsers (either the LaTeX renderer or the code one).

@captainsafia captainsafia transferred this issue from nteract/nteract Jun 10, 2020
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

4 participants