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

Raw HTML is not interpreted as one #437

Closed
flyinggrizzly opened this issue Oct 16, 2020 · 4 comments · Fixed by #450
Closed

Raw HTML is not interpreted as one #437

flyinggrizzly opened this issue Oct 16, 2020 · 4 comments · Fixed by #450
Labels
documentation Improvements or additions to documentation Zettel Format Anything that affects the structure of the zettel text
Milestone

Comments

@flyinggrizzly
Copy link
Contributor

Inserting the following HTML into a note:

<!-- inline to prevent possible interpretation of indentation as code block -->
<video><source src='./static/otaku-builder-sdcs-unicorn-destroy-mode.mp4' type='video/mp4' /></video>

results in the following in the generated page:

image

<p>
  <a href="video">video</a>
  <span class="ui left pointing red basic label">links to non-existant zettel: video</span>
  <source src="./static/otaku-builder-sdcs-unicorn-destroy-mode.mp4" type="video/mp4">
  <a href="/video">/video</a>
</p>

I can embed the video with an iframe, but I prefer to actually save files that are potentially ephemeral (like Youtube videos).

@srid
Copy link
Owner

srid commented Oct 16, 2020

Raw HTML needs to be wrapped in code-blocks, in order to disambiguate the meaning of <video> (how can neuron tell it is not a link to video.md? Try:

    ``` {=html}
    <video><source src='./static/otaku-builder-sdcs-unicorn-destroy-mode.mp4' type='video/mp4' /></video>
    ```

Example: https://raw.githubusercontent.com/srid/guide.cerveau.app/master/index.md

@srid srid added the documentation Improvements or additions to documentation label Oct 16, 2020
@srid srid added this to the Next milestone Oct 16, 2020
@srid
Copy link
Owner

srid commented Oct 16, 2020

@srid srid changed the title HTML <video /> element is interpreted as a Zettel link Raw HTML is not interpreted as one Oct 16, 2020
@flyinggrizzly
Copy link
Contributor Author

flyinggrizzly commented Oct 18, 2020

Yup, that works, thank you! I’m also now seeing the autolink footnote in the Neuron guide, which I’m assuming why Neuron has the issue with (some, but not all?) HTML elements.

Given my expectation that valid HTML is valid markdown, this definitely took me by surprise.

(I’m trying to figure out how to phrase this that’s not just entitled user, but I’m sorry if I miss the mark)—would it be worth considering deprecating the auto link behavior in Neuron now that wiki links are recommended, so that there isn’t the issue with HTML in MD? Not fully supporting HTML in the markdown is definitely a surprise for people who are used to MD, especially anyone who uses it with other static site generators.

This would make migrating potentially easier for folks coming from pure MD environments.

But I’m also very aware that it would leave existing Neuron users with a problem...

If that breaking change isn’t something you want to do, maybe something about this in the Zettel Markdown docs at least would help others who run into the same issue?

@srid
Copy link
Owner

srid commented Oct 19, 2020

<..> style links are already considered deprecated. Dropping support for them can be considered, as long as there is an automated migration path (a reliable script that rewrites links, for instance) for existing notebooks. Also note that internally neuron converts [[..]] links to <..> links; so that will have to be dealt with as well (which should hopefully be fairly simple, by full expanding the URIs, eg: [[foo]] -> <z:link/foo>, so as to disambiguate from HTML tags).

Meanwhile we can indeed document all this. A new page, under https://neuron.zettel.page/markdown.html, can be added describing how to use raw HTML. PR welcome for that!

@srid srid added the Zettel Format Anything that affects the structure of the zettel text label Oct 29, 2020
@srid srid closed this as completed in #450 Oct 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation Zettel Format Anything that affects the structure of the zettel text
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants