Is it possible to preserve the language for fenced code blocks so the show notes would have syntax highlighting
```python
import time
print(time.now())
https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks#syntax-highlighting
Is it possible to preserve the language for fenced code blocks so the show notes would have syntax highlighting
```md
```python
import time
print(time.now())
```
This is a nice feature, however it is implemented (or was last time I looked) by lots of <span> and <div> tags. When the show arrives on the Internet Archive (IA) these are all stripped out.
In short, I disabled this feature because at the time the IA stripped all but the most basic HTML. I'd be happy to review it; the IA code is changed silently over time, so this might no longer be the case.
This is a nice feature, however it is implemented (or was last time I looked) by lots of `<span>` and `<div>` tags. When the show arrives on the Internet Archive (IA) these are all stripped out.
In short, I disabled this feature because at the time the IA stripped all but the most basic HTML. I'd be happy to review it; the IA code is changed silently over time, so this might no longer be the case.
There are 2 ways that I know how to show syntax highlighting.
JavaScript reads the code block and wraps tokens in SPANS with classes, or wraps them in <b>, <em>, <i>, <strong> etc, which have special styles because they are in a classed <pre> block.
The newish way is to use the custom highlighting API. So instead of splitting into tokens the JavaScript just need to know the character positions to set Ranges of text that get a highlight name that then is associated to a style. See https://developer.mozilla.org/en-US/docs/Web/API/CSS_Custom_Highlight_API
There are 2 ways that I know how to show syntax highlighting.
JavaScript reads the code block and wraps _tokens_ in SPANS with classes, or wraps them in `<b>, <em>, <i>, <strong>` etc, which have special styles because they are in a classed `<pre>` block.
The _newish_ way is to use the custom highlighting API. So instead of splitting into _tokens_ the JavaScript just need to know the character positions to set Ranges of text that get a highlight **name** that then is associated to a style. See https://developer.mozilla.org/en-US/docs/Web/API/CSS_Custom_Highlight_API
We are now using WYSIWYG library from quilljs and unfortunately it does not support it.
We could run a load of hacks but I don't see the value as we transport the code else where.
I think this is too much to implement and maintain.
We are now using WYSIWYG library from [quilljs](https://quilljs.com/) and unfortunately it does not support it.
We could run a load of hacks but I don't see the value as we transport the code else where.
I think this is too much to implement and maintain.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks#syntax-highlighting
Is it possible to preserve the language for fenced code blocks so the show notes would have syntax highlighting
This is a nice feature, however it is implemented (or was last time I looked) by lots of
<span>and<div>tags. When the show arrives on the Internet Archive (IA) these are all stripped out.In short, I disabled this feature because at the time the IA stripped all but the most basic HTML. I'd be happy to review it; the IA code is changed silently over time, so this might no longer be the case.
There are 2 ways that I know how to show syntax highlighting.
JavaScript reads the code block and wraps tokens in SPANS with classes, or wraps them in
<b>, <em>, <i>, <strong>etc, which have special styles because they are in a classed<pre>block.The newish way is to use the custom highlighting API. So instead of splitting into tokens the JavaScript just need to know the character positions to set Ranges of text that get a highlight name that then is associated to a style. See https://developer.mozilla.org/en-US/docs/Web/API/CSS_Custom_Highlight_API
We are now using WYSIWYG library from quilljs and unfortunately it does not support it.
We could run a load of hacks but I don't see the value as we transport the code else where.
I think this is too much to implement and maintain.