-
Notifications
You must be signed in to change notification settings - Fork 776
Open
Description
关键信息
expressive-code 格式的代码的dom是这样的
<div class="expressive-code">
<link rel="stylesheet" href="..." />
<script type="module" src="..." data-astro-exec=""></script>
<figure class="frame has-title">
<!-- 可能存在标题 -->
<figcaption class="header">
<span class="title">...</span>
</figcaption>
<!-- 代码块 语言信息 -->
<pre data-language="typescript" class="wrap" style="--ecMaxLine:55ch">
<code>
<div class="ec-line">
<!-- 可能存在行号 -->
<div class="gutter"><div class="ln" aria-hidden="true">1</div></div>
<div class="code">
<span style="--0:#F97583">import</span>
<span style="--0:#E1E4E8"> { defineCollection } </span>
<span style="--0:#F97583">from</span>
<span style="--0:#E1E4E8"> </span>
<span style="--0:#9ECBFF">"astro:content"</span>
<span style="--0:#E1E4E8">;</span></div>
</div>
<div class="ec-line">
<!-- 可能存在行号 -->
<div class="gutter"><div class="ln" aria-hidden="true">1</div></div>
<div class="code"><span style="--0:#...">...</span></div>
</div>
<!-- (结构同上,行号递增,部分含 --ecIndent 样式) -->
<div class="ec-line" style="--ecIndent:2ch">...</div>
<div class="ec-line" style="--ecIndent:4ch">...</div>
</code>
</pre>
<!-- 复制按钮 -->
<div class="copy">
<div aria-live="polite"></div>
<button title="..." data-copied="..." data-code="...">
<div></div>
</button>
</div>
</figure>
</div>错误效果
解析之前的原文页面,本应该是多行
{
"packages": [
{
"root": "moonbitlang/x",
"rel": "",
"artifact": ".mooncakes/moonbitlang/x",
"moonmod": ".mooncakes/moonbitlang/x/moon.mod.json",
"license": "Apache-2.0"
}
],
"summary": {
"total": 1,
"unknown_license": 0
}
}解析之后的页面会被错误地压成一行
{ "packages": [ { "root": "moonbitlang/x", "rel": "", "artifact": ".mooncakes/moonbitlang/x", "moonmod": ".mooncakes/moonbitlang/x/moon.mod.json", "license": "Apache-2.0" } ], "summary": { "total": 1, "unknown_license": 0 } }Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels