CudaText: Wish to highlight fenced code-blocks in Markdown (and other lexers)
From @WebMechanic
is there a way to get syntax coloring in fenced code blocks such as this:
```html
<aside><h1>Feature request</h1></aside>
```
that is using ```html et al.
If I have a document with loads of these blocks I have to run Code to get a nicer preview (or to eventually render the file into .html or .pdf)
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 1
- Comments: 18 (11 by maintainers)
Commits related to this issue
- lex MD: fixing #3829 — committed to Alexey-T/CudaText by Alexey-T 3 years ago
- fixing PHP in fenced block, https://github.com/Alexey-T/CudaText/issues/3829#issuecomment-986766495 — committed to Alexey-T/CudaText by Alexey-T 3 years ago
@WebMechanic I moved the PHP heredoc wish to the new topic #3853
I wrote about lite lexers this
Beta is here http://uvviewsoft.com/c/
Pls test?
@jairomartinezA @eltonfabricio10 @kvichans @GHNewbiee
Jairo,I am going to write this to the wiki. not sure it’s OK solution, because it needs the editing of alias.ini
This is looking great!
It appears the PHP lexer requires one to include
<?php
at the top of the block or there’s no colouring. It does however also faall back toHTML if hte PHP block is closed?>
. Just wondering if this is required and if other langages that req. such a prolog are also “affected” by this; maybe ASP and JSP? I’ll take it as a feature though, not a bug, 'Cos you can have PHP and HTML in the fenced block.out of my head it’d be useful for heredocs in PHP. Here the bits between
<<<HTML
andHTML;
would be highlighted.The String ‘HTML’ is not explicitly naming the language within the block, could be any “label” and just has to be identical at the ende. It’S just convention to use HTML oder CSS or SQL and some IDE’s use this as a hint to switch sytax highlighting inside this block.
Partially fixed yet only for HTML, not for others.
Full list of lexer aliasees https://github.com/highlightjs/highlight.js/blob/main/SUPPORTED_LANGUAGES.md