<table><tr><td style="">nibags edited the summary of this revision. <a href="https://phabricator.kde.org/transactions/detail/PHID-XACT-DREV-jgnapwznv3fxutp/">(Show Details)</a><br />nibags added reviewers: cullmann, dhaumann.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D23371">View Revision</a></tr></table><br /><div><strong>CHANGES TO REVISION SUMMARY</strong><div><div style="white-space: pre-wrap; color: #74777D;"><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">## Improve & fix detection of bold/italic text<br />
<br />
BUG: 390309<br />
<br />
In bold and italic text highlighting, underscores and asterics aren't allowed inside, for example `**some_text**` isn't highlighted correctly. I have improved regex to detect bold and italic text: now asterisks, underscores and escapes are allowed inside.<br />
{F7273185}<br />
<br />
## Improve fenced code blocks<br />
<br />
The way to write fenced code blocks varies depending on the Markdown/MultiMarkdown implementation. Some support only 3 backticks, others more than 3 backticks, others both; and others 3 tildes (`~`). [1]<br />
<br />
Therefore, I think it's a good idea to support all implementations: code blocks can be written with 3 backticks or more, or with 3 tildes or more . Other editors, such as Visutal Studio Code, Atom and Sublime Text highlight fenced code blocks in this way. <br />
Unfortunately, this is only possible using dynamic rules with several RegExpr, which isn't very optimal. I have no problem modifying that if you don't like it.<br />
{F7273187}<br />
<br />
**Also:**<br />
* Add folding in fenced code blocks.<br />
* Add more keywords to identify languages.<br />
* Add to highlight in fenced code blocks the languages that are already loaded by default, since they are included via IncludeRules (JavaScript, TypeScript, JSX, SQL, Mustache/Handlebars, reST & Doxygen).<br />
* Add more languages in the code blocks. Some of the most popular languages are included [3] [4]: C, Go, Java, JavaScript, TypeScript, Matlab, Perl, R & Ruby.<br />
<br />
## Improve code blocks<br />
<br />
* Highlight single code with more than one backticks. [2]<br />
{F7273189}<br />
* Fix: highlight indented code only after an empty line.<br />
{F7273193}<br />
<br />
## Improve highlighting of links and references<br />
{F7273195}<br />
<br />
## Improve metadata highlighting<br />
<br />
Previously, some metadata Keys were highlighted anywhere in the document. Now the metadata is highlighted only on the first line of the Markdown document. [6] [7]<br />
{F7273196}<br />
<br />
## Improves list detection<br />
<br />
Through dynamic rules, the indentation of lists is captured, in order to correctly highlight the indented content in them.<br />
Now the text within the lists is highlighted using "dsNormal", so as not to saturate Markdown documents with many colors.<br />
{F7273197}<br />
<br />
## Add support of inline HTML<br />
<br />
`IncludeRules` is used to highlight only HTML tags. [8]<br />
<br />
## Others<br />
<br />
* Highlight checkboxs in lists.<br />
{F7273202}<br />
* Add escape characters [5].<br />
* Add `##Alerts` and `##Modelines` in the comments.<br />
* Some minor improvements, such as replacing some RegExpr rules and adding `column="0"` in some rules.<br />
<br />
**Sources:**<br />
* [1] Fenced Markdown code blocks: <https://meta.stackexchange.com/questions/125148/implement-style-fenced-markdown-code-blocks/143705#143705><br />
* [2] Markdown Syntax Documentation. Code: <https://daringfireball.net/projects/markdown/syntax#code><br />
* [3] GitHut - Programming Languages and GitHub: <https://githut.info/><br />
* [4] Most Popular and Influential Programming Languages of 2018: <https://stackify.com/popular-programming-languages-2018/><br />
* [5] Markdown Syntax Documentation. Backslash escapes: <https://daringfireball.net/projects/markdown/syntax#backslash><br />
* [6] MutiMarkdown Metadata: <https://fletcher.github.io/MultiMarkdown-5/metadata.html><br />
* [7] Markdown metadata format: <https://stackoverflow.com/questions/44215896/markdown-metadata-format><br />
* [8] Markdown Syntax Documentation. Inline HTML: <https://daringfireball.net/projects/markdown/syntax#html></span></div></div></div><br /><div><strong>REPOSITORY</strong><div><div>R216 Syntax Highlighting</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D23371">https://phabricator.kde.org/D23371</a></div></div><br /><div><strong>To: </strong>nibags, cullmann, dhaumann<br /><strong>Cc: </strong>kwrite-devel, kde-frameworks-devel, LeGast00n, GB_2, domson, michaelh, ngraham, bruns, demsking, cullmann, sars, dhaumann<br /></div>