mirror of
https://github.com/vlang/v.git
synced 2025-09-10 07:47:20 -04:00
tools: fix v doc
not converting <s> in plain code blocks into encoded html entities in its .html output
This commit is contained in:
parent
1c992de86d
commit
715dc31161
@ -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 {
|
fn (f &MdHtmlCodeHighlighter) transform_content(parent markdown.ParentType, text string) string {
|
||||||
if parent is markdown.MD_BLOCKTYPE && parent == .md_block_code {
|
if parent is markdown.MD_BLOCKTYPE && parent == .md_block_code {
|
||||||
if f.language == '' {
|
if f.language == '' {
|
||||||
return text
|
return html.escape(text)
|
||||||
}
|
}
|
||||||
output := html_highlight(text, f.table)
|
output := html_highlight(text, f.table)
|
||||||
// Reset the language, so that it will not persist between blocks,
|
// Reset the language, so that it will not persist between blocks,
|
||||||
|
10
cmd/tools/vdoc/testdata/output_formats/README.md
vendored
10
cmd/tools/vdoc/testdata/output_formats/README.md
vendored
@ -150,4 +150,14 @@ A code block without a specific language should be rendered verbatim:
|
|||||||
└── main.v
|
└── 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.
|
The End.
|
||||||
|
18
cmd/tools/vdoc/testdata/output_formats/main.ansi
vendored
18
cmd/tools/vdoc/testdata/output_formats/main.ansi
vendored
@ -128,6 +128,14 @@ A code block without a specific language should be rendered verbatim:
|
|||||||
│ └── main.js
|
│ └── main.js
|
||||||
└── main.v
|
└── 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.
|
The End.
|
||||||
[94mmodule[39m [32mmain[39m
|
[94mmodule[39m [32mmain[39m
|
||||||
## Description
|
## Description
|
||||||
@ -281,6 +289,16 @@ The End.
|
|||||||
└── main.v
|
└── 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.
|
The End.
|
||||||
|
|
||||||
[94mconst[39m omega = [94m3[39m [90m// should be first[39m
|
[94mconst[39m omega = [94m3[39m [90m// should be first[39m
|
||||||
|
@ -97,6 +97,12 @@ doc2 <span class="token operator">:=</span> toml<span class="token punctuation">
|
|||||||
│ └── js/
|
│ └── js/
|
||||||
│ └── main.js
|
│ └── main.js
|
||||||
└── main.v
|
└── 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<s> // 2:33.015
|
||||||
|
s.mi<s> // 33.015s
|
||||||
|
mi.mc<ms> // 15.007ms
|
||||||
|
mc.ns<ns> // 7.234us
|
||||||
|
ns<ns> // 234ns
|
||||||
</code></pre><p>The End.</p>
|
</code></pre><p>The End.</p>
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
|
10
cmd/tools/vdoc/testdata/output_formats/main.text
vendored
10
cmd/tools/vdoc/testdata/output_formats/main.text
vendored
@ -150,6 +150,16 @@ module main
|
|||||||
└── main.v
|
└── 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.
|
The End.
|
||||||
|
|
||||||
const omega = 3 // should be first
|
const omega = 3 // should be first
|
||||||
|
Loading…
x
Reference in New Issue
Block a user