tools: fix v doc not converting <s> in plain code blocks into encoded html entities in its .html output

This commit is contained in:
Delyan Angelov 2024-09-11 19:42:44 +03:00
parent 1c992de86d
commit 715dc31161
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
5 changed files with 45 additions and 1 deletions

View File

@ -617,7 +617,7 @@ fn (f &MdHtmlCodeHighlighter) transform_attribute(p markdown.ParentType, name st
fn (f &MdHtmlCodeHighlighter) transform_content(parent markdown.ParentType, text string) string {
if parent is markdown.MD_BLOCKTYPE && parent == .md_block_code {
if f.language == '' {
return text
return html.escape(text)
}
output := html_highlight(text, f.table)
// Reset the language, so that it will not persist between blocks,

View File

@ -150,4 +150,14 @@ A code block without a specific language should be rendered verbatim:
└── main.v
```
The s tags here in the code block, should be rendered verbatim, not interpreted as HTML ones:
```
h:m:s // 5:02:33
m:s.mi<s> // 2:33.015
s.mi<s> // 33.015s
mi.mc<ms> // 15.007ms
mc.ns<ns> // 7.234us
ns<ns> // 234ns
```
The End.

View File

@ -128,6 +128,14 @@ A code block without a specific language should be rendered verbatim:
│ └── main.js
└── main.v
The s tags here in the code block, should be rendered verbatim, not interpreted as HTML ones:
h:m:s // 5:02:33
m:s.mi<s> // 2:33.015
s.mi<s> // 33.015s
mi.mc<ms> // 15.007ms
mc.ns<ns> // 7.234us
ns<ns> // 234ns
The End.
module main
## Description
@ -281,6 +289,16 @@ The End.
└── main.v
```
The s tags here in the code block, should be rendered verbatim, not interpreted as HTML ones:
```
h:m:s // 5:02:33
m:s.mi<s> // 2:33.015
s.mi<s> // 33.015s
mi.mc<ms> // 15.007ms
mc.ns<ns> // 7.234us
ns<ns> // 234ns
```
The End.
const omega = 3 // should be first

View File

@ -97,6 +97,12 @@ doc2 <span class="token operator">:=</span> toml<span class="token punctuation">
│ └── js/
│ └── main.js
└── main.v
</code></pre><p>The s tags here in the code block, should be rendered verbatim, not interpreted as HTML ones:</p><pre><code>h:m:s // 5:02:33
m:s.mi&lt;s&gt; // 2:33.015
s.mi&lt;s&gt; // 33.015s
mi.mc&lt;ms&gt; // 15.007ms
mc.ns&lt;ns&gt; // 7.234us
ns&lt;ns&gt; // 234ns
</code></pre><p>The End.</p>
</section>

View File

@ -150,6 +150,16 @@ module main
└── main.v
```
The s tags here in the code block, should be rendered verbatim, not interpreted as HTML ones:
```
h:m:s // 5:02:33
m:s.mi<s> // 2:33.015
s.mi<s> // 33.015s
mi.mc<ms> // 15.007ms
mc.ns<ns> // 7.234us
ns<ns> // 234ns
```
The End.
const omega = 3 // should be first