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

HTML comments shouldn't render in mardkown cells #34

Closed
fperez opened this issue Feb 8, 2023 · 3 comments
Closed

HTML comments shouldn't render in mardkown cells #34

fperez opened this issue Feb 8, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@fperez
Copy link

fperez commented Feb 8, 2023

Describe the bug

context
When I type an html comment in markdown. Consider a cell with this content:

A **repository**: a group of *linked* commits

<!-- offline: 
![](files/images/threecommits.png)

<img src="https://raw.github.com/fperez/reprosw/master/fig/threecommits.png" >
-->

expectation
I expected it not to render the comment, and show only this:

image

bug
But instead it renders as:

image

problem
This is a problem b/c we often use comments to temporarily elide parts of a markdown cell or provide extra info not meant to be rendered.

Reproduce the bug

See above - happens with 0.1.3

Edit

Fixed accidentally incorrect screenie.

@fperez fperez added the bug Something isn't working label Feb 8, 2023
@mcauthorn
Copy link

In the event it helps: I've run into a version of the same bug. I had a markdown cell with the following HTML inside of it to render a resized image, which worked before installation of jupyterlab-mystjs:

<div>
    <img src="attachment:61feef8d-4746-446a-bfbd-191d469fbcdc.png" width="250"/>
</div>

After installation, the raw HTML is rendering instead of the (expected) image:
image

@rowanc1
Copy link
Member

rowanc1 commented Feb 8, 2023

Thanks @mcauthorn and @fperez for the feedback, we will aim to get this fixed up soon, I think we somehow need to enable the html parts:

@fwkoch I have put together a sandbox example here html-comments/images it does looks like they do get parsed to html, but I think we aren't taking them the rest of the way?

@rowanc1
Copy link
Member

rowanc1 commented Feb 8, 2023

Hi @fperez and @mcauthorn -- there is a new version v0.1.4 that provides better support for HTML parsing. It does catch the comments, and those are now no longer rendered (thank you @fwkoch!).

There is also a new feature that you can partially disable the full-renderer, and opt instead to open a MyST and a traditional version of the same notebook through the UI. This will require you to explicitly disable the "plugin" part, this will enable the other renderer -- there is more info in the readme!

The other HTML issues I am going to track in jupyter-book/jupyterlab-myst#64 (e.g. @mcauthorn the width isn't preserved).

@rowanc1 rowanc1 closed this as completed Feb 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants