question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Icons for admonishments get parsed into first HTML element

See original GitHub issue

https://github.com/iterative/dvc.org/pull/3371 introduced admonishments. While very nice, I ran into a few oddities while using them. Right now I am incorporating them through raw HTML rather than MD.

<admon type="warn">
In this example we are using a <code>t2.micro</code> AWS EC2 instance. At the time of writing this is included in the AWS free tier. Make sure that you qualify for this free usage to prevent unexpected spending. When you specify a bulkier <code>cloud-type</code>, your expenses will rise.
</admon>

Because backticks don’t get parsed within the HTML element (or e.g. [link](ref)) I simply used <code></code> this has the side effect of prepending a warning emoji to the first code element:

Screenshot 2022-04-08 at 12 23 29

I circumvented this by explicitly using a <p> element, but I’m not sure what the intended behavior here is.

<admon type="warn">
<p>
In this example we are using a <code>t2.micro</code> AWS EC2 instance. At the time of writing this is included in the AWS free tier. Make sure that you qualify for this free usage to prevent unexpected spending. When you specify a bulkier <code>cloud-type</code>, your expenses will rise.
</p>
</admon>

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
julieg18commented, Apr 11, 2022

It’s an unfortunate downside of using gatsby-transformer-remark in our engine, as it’s not quite built for custom components like something like MDX is, the parser is very finicky about how components are written.

Correct! Empty lines are a must when using our custom HTML components. Since I don’t think there is anything we can do about it on our end, going to go ahead and close this issue!

0reactions
rogermparentcommented, Apr 8, 2022

is this how we want it to work?

It’s an unfortunate downside of using gatsby-transformer-remark in our engine, as it’s not quite built for custom components like something like MDX is, the parser is very finicky about how components are written.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Admonitions | Asciidoctor Docs
These are called admonitions. This page introduces you to admonition types AsciiDoc provides, how to add admonitions to your document, and how to...
Read more >
$v:admonition-icons - DocBook xslTNG
These are the icons that will be presented next to admonitions. They're single Unicode characters in the default distribution, but they can be...
Read more >
Which semantic HTML tag for displaying side notes and ...
I believe the accepted answer is not quite correct. According to the HTML5 working draft, the <aside> element can be used to mark...
Read more >
Syntax Extensions - MyST-Parser
Math is parsed by adding to the myst_enable_extensions list option, in the sphinx conf.py ... to inhibit this override and process all HTML...
Read more >
reStructuredText Directives - Docutils - SourceForge
The "code" directive constructs a literal block. If the code language is specified, the content is parsed by the Pygments syntax highlighter and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found