Closed brc-dd closed 5 months ago
fixes the concerns in #106
/cc @Jinjiang you can try something like this in demo/guide/introduction.md to test:
demo/guide/introduction.md
## What & {{ <script> (1) }} \<script setup> is Vue.js?
The browser bundle only has this code (<200B after gzip/br):
const n=/&([a-z0-9]+|#[0-9]{1,6}|#x[0-9a-fA-F]{1,6});?/gi;let t;function o(e){return t||(t=new DOMParser),t.parseFromString(e,"text/html").documentElement.textContent}function c(e){return n.lastIndex=0,e.replace(n,r=>o(r))
unminified:
const ENTITY_RE = /&([a-z0-9]+|#[0-9]{1,6}|#x[0-9a-fA-F]{1,6});?/gi; let p; function decodeHTML5(value) { if (!p) p = new DOMParser(); return p.parseFromString(value, "text/html").documentElement.textContent; } function decode(value) { ENTITY_RE.lastIndex = 0; return value.replace(ENTITY_RE, (m) => decodeHTML5(m)); }
fixes the concerns in #106
/cc @Jinjiang you can try something like this in
demo/guide/introduction.md
to test:The browser bundle only has this code (<200B after gzip/br):
unminified: