aboutsummaryrefslogtreecommitdiffhomepage
path: root/nuldoc-src/html.ts
diff options
context:
space:
mode:
Diffstat (limited to 'nuldoc-src/html.ts')
-rw-r--r--nuldoc-src/html.ts8
1 files changed, 6 insertions, 2 deletions
diff --git a/nuldoc-src/html.ts b/nuldoc-src/html.ts
index 70b5748..b94877a 100644
--- a/nuldoc-src/html.ts
+++ b/nuldoc-src/html.ts
@@ -115,15 +115,19 @@ function toHtmlText(dom: Document): string {
function nodeToHtmlText(n: Node, ctx: Context): string {
if (n.kind === "text") {
- return textNodeToHtmlText(n, ctx);
+ if (n.raw) {
+ return n.content;
+ } else {
+ return textNodeToHtmlText(n, ctx);
+ }
} else {
return elementNodeToHtmlText(n, ctx);
}
}
function textNodeToHtmlText(t: Text, ctx: Context): string {
- if (ctx.isInPre) return t.content;
const s = encodeSpecialCharacters(t.content);
+ if (ctx.isInPre) return s;
// TODO: 日本語で改行するときはスペースを入れない
return s