@tamagui/code-to-html 1.52.1 → 1.52.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/highlightLine.js.map +1 -1
- package/dist/cjs/highlightWord.js.map +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/highlightLine.js +22 -22
- package/dist/esm/highlightLine.js.map +1 -1
- package/dist/esm/highlightWord.js +22 -22
- package/dist/esm/highlightWord.js.map +1 -1
- package/dist/esm/index.js +22 -22
- package/dist/esm/index.js.map +1 -1
- package/package.json +2 -2
package/dist/esm/index.js
CHANGED
|
@@ -531,7 +531,7 @@ var require_tokenizer = __commonJS({
|
|
|
531
531
|
}
|
|
532
532
|
return -1;
|
|
533
533
|
}
|
|
534
|
-
var Tokenizer = class {
|
|
534
|
+
var Tokenizer = class _Tokenizer {
|
|
535
535
|
constructor() {
|
|
536
536
|
this.preprocessor = new Preprocessor();
|
|
537
537
|
this.tokenQueue = [];
|
|
@@ -581,7 +581,7 @@ var require_tokenizer = __commonJS({
|
|
|
581
581
|
this.preprocessor.retreat();
|
|
582
582
|
}
|
|
583
583
|
this.active = false;
|
|
584
|
-
this.tokenQueue.push({ type:
|
|
584
|
+
this.tokenQueue.push({ type: _Tokenizer.HIBERNATION_TOKEN });
|
|
585
585
|
return true;
|
|
586
586
|
}
|
|
587
587
|
return false;
|
|
@@ -643,7 +643,7 @@ var require_tokenizer = __commonJS({
|
|
|
643
643
|
//Token creation
|
|
644
644
|
_createStartTagToken() {
|
|
645
645
|
this.currentToken = {
|
|
646
|
-
type:
|
|
646
|
+
type: _Tokenizer.START_TAG_TOKEN,
|
|
647
647
|
tagName: "",
|
|
648
648
|
selfClosing: false,
|
|
649
649
|
ackSelfClosing: false,
|
|
@@ -652,7 +652,7 @@ var require_tokenizer = __commonJS({
|
|
|
652
652
|
}
|
|
653
653
|
_createEndTagToken() {
|
|
654
654
|
this.currentToken = {
|
|
655
|
-
type:
|
|
655
|
+
type: _Tokenizer.END_TAG_TOKEN,
|
|
656
656
|
tagName: "",
|
|
657
657
|
selfClosing: false,
|
|
658
658
|
attrs: []
|
|
@@ -660,13 +660,13 @@ var require_tokenizer = __commonJS({
|
|
|
660
660
|
}
|
|
661
661
|
_createCommentToken() {
|
|
662
662
|
this.currentToken = {
|
|
663
|
-
type:
|
|
663
|
+
type: _Tokenizer.COMMENT_TOKEN,
|
|
664
664
|
data: ""
|
|
665
665
|
};
|
|
666
666
|
}
|
|
667
667
|
_createDoctypeToken(initialName) {
|
|
668
668
|
this.currentToken = {
|
|
669
|
-
type:
|
|
669
|
+
type: _Tokenizer.DOCTYPE_TOKEN,
|
|
670
670
|
name: initialName,
|
|
671
671
|
forceQuirks: false,
|
|
672
672
|
publicId: null,
|
|
@@ -680,7 +680,7 @@ var require_tokenizer = __commonJS({
|
|
|
680
680
|
};
|
|
681
681
|
}
|
|
682
682
|
_createEOFToken() {
|
|
683
|
-
this.currentToken = { type:
|
|
683
|
+
this.currentToken = { type: _Tokenizer.EOF_TOKEN };
|
|
684
684
|
}
|
|
685
685
|
//Tag attributes
|
|
686
686
|
_createAttr(attrNameFirstCh) {
|
|
@@ -690,7 +690,7 @@ var require_tokenizer = __commonJS({
|
|
|
690
690
|
};
|
|
691
691
|
}
|
|
692
692
|
_leaveAttrName(toState) {
|
|
693
|
-
if (
|
|
693
|
+
if (_Tokenizer.getTokenAttr(this.currentToken, this.currentAttr.name) === null) {
|
|
694
694
|
this.currentToken.attrs.push(this.currentAttr);
|
|
695
695
|
} else {
|
|
696
696
|
this._err(ERR.duplicateAttribute);
|
|
@@ -705,9 +705,9 @@ var require_tokenizer = __commonJS({
|
|
|
705
705
|
this._emitCurrentCharacterToken();
|
|
706
706
|
const ct = this.currentToken;
|
|
707
707
|
this.currentToken = null;
|
|
708
|
-
if (ct.type ===
|
|
708
|
+
if (ct.type === _Tokenizer.START_TAG_TOKEN) {
|
|
709
709
|
this.lastStartTagName = ct.tagName;
|
|
710
|
-
} else if (ct.type ===
|
|
710
|
+
} else if (ct.type === _Tokenizer.END_TAG_TOKEN) {
|
|
711
711
|
if (ct.attrs.length > 0) {
|
|
712
712
|
this._err(ERR.endTagWithAttributes);
|
|
713
713
|
}
|
|
@@ -747,11 +747,11 @@ var require_tokenizer = __commonJS({
|
|
|
747
747
|
}
|
|
748
748
|
}
|
|
749
749
|
_emitCodePoint(cp) {
|
|
750
|
-
let type =
|
|
750
|
+
let type = _Tokenizer.CHARACTER_TOKEN;
|
|
751
751
|
if (isWhitespace(cp)) {
|
|
752
|
-
type =
|
|
752
|
+
type = _Tokenizer.WHITESPACE_CHARACTER_TOKEN;
|
|
753
753
|
} else if (cp === $.NULL) {
|
|
754
|
-
type =
|
|
754
|
+
type = _Tokenizer.NULL_CHARACTER_TOKEN;
|
|
755
755
|
}
|
|
756
756
|
this._appendCharToCurrentCharacterToken(type, toChar(cp));
|
|
757
757
|
}
|
|
@@ -763,7 +763,7 @@ var require_tokenizer = __commonJS({
|
|
|
763
763
|
//NOTE: used then we emit character explicitly. This is always a non-whitespace and a non-null character.
|
|
764
764
|
//So we can avoid additional checks here.
|
|
765
765
|
_emitChars(ch) {
|
|
766
|
-
this._appendCharToCurrentCharacterToken(
|
|
766
|
+
this._appendCharToCurrentCharacterToken(_Tokenizer.CHARACTER_TOKEN, ch);
|
|
767
767
|
}
|
|
768
768
|
// Character reference helpers
|
|
769
769
|
_matchNamedCharacterReference(startCp) {
|
|
@@ -2891,7 +2891,7 @@ var require_formatting_element_list = __commonJS({
|
|
|
2891
2891
|
"../../node_modules/rehype-parse/node_modules/parse5/lib/parser/formatting-element-list.js"(exports, module) {
|
|
2892
2892
|
"use strict";
|
|
2893
2893
|
var NOAH_ARK_CAPACITY = 3;
|
|
2894
|
-
var FormattingElementList = class {
|
|
2894
|
+
var FormattingElementList = class _FormattingElementList {
|
|
2895
2895
|
constructor(treeAdapter) {
|
|
2896
2896
|
this.length = 0;
|
|
2897
2897
|
this.entries = [];
|
|
@@ -2909,7 +2909,7 @@ var require_formatting_element_list = __commonJS({
|
|
|
2909
2909
|
const neNamespaceURI = this.treeAdapter.getNamespaceURI(newElement);
|
|
2910
2910
|
for (let i = this.length - 1; i >= 0; i--) {
|
|
2911
2911
|
const entry = this.entries[i];
|
|
2912
|
-
if (entry.type ===
|
|
2912
|
+
if (entry.type === _FormattingElementList.MARKER_ENTRY) {
|
|
2913
2913
|
break;
|
|
2914
2914
|
}
|
|
2915
2915
|
const element3 = entry.element;
|
|
@@ -2953,13 +2953,13 @@ var require_formatting_element_list = __commonJS({
|
|
|
2953
2953
|
}
|
|
2954
2954
|
//Mutations
|
|
2955
2955
|
insertMarker() {
|
|
2956
|
-
this.entries.push({ type:
|
|
2956
|
+
this.entries.push({ type: _FormattingElementList.MARKER_ENTRY });
|
|
2957
2957
|
this.length++;
|
|
2958
2958
|
}
|
|
2959
2959
|
pushElement(element3, token) {
|
|
2960
2960
|
this._ensureNoahArkCondition(element3);
|
|
2961
2961
|
this.entries.push({
|
|
2962
|
-
type:
|
|
2962
|
+
type: _FormattingElementList.ELEMENT_ENTRY,
|
|
2963
2963
|
element: element3,
|
|
2964
2964
|
token
|
|
2965
2965
|
});
|
|
@@ -2973,7 +2973,7 @@ var require_formatting_element_list = __commonJS({
|
|
|
2973
2973
|
}
|
|
2974
2974
|
}
|
|
2975
2975
|
this.entries.splice(bookmarkIdx + 1, 0, {
|
|
2976
|
-
type:
|
|
2976
|
+
type: _FormattingElementList.ELEMENT_ENTRY,
|
|
2977
2977
|
element: element3,
|
|
2978
2978
|
token
|
|
2979
2979
|
});
|
|
@@ -2992,7 +2992,7 @@ var require_formatting_element_list = __commonJS({
|
|
|
2992
2992
|
while (this.length) {
|
|
2993
2993
|
const entry = this.entries.pop();
|
|
2994
2994
|
this.length--;
|
|
2995
|
-
if (entry.type ===
|
|
2995
|
+
if (entry.type === _FormattingElementList.MARKER_ENTRY) {
|
|
2996
2996
|
break;
|
|
2997
2997
|
}
|
|
2998
2998
|
}
|
|
@@ -3001,7 +3001,7 @@ var require_formatting_element_list = __commonJS({
|
|
|
3001
3001
|
getElementEntryInScopeWithTagName(tagName) {
|
|
3002
3002
|
for (let i = this.length - 1; i >= 0; i--) {
|
|
3003
3003
|
const entry = this.entries[i];
|
|
3004
|
-
if (entry.type ===
|
|
3004
|
+
if (entry.type === _FormattingElementList.MARKER_ENTRY) {
|
|
3005
3005
|
return null;
|
|
3006
3006
|
}
|
|
3007
3007
|
if (this.treeAdapter.getTagName(entry.element) === tagName) {
|
|
@@ -3013,7 +3013,7 @@ var require_formatting_element_list = __commonJS({
|
|
|
3013
3013
|
getElementEntry(element3) {
|
|
3014
3014
|
for (let i = this.length - 1; i >= 0; i--) {
|
|
3015
3015
|
const entry = this.entries[i];
|
|
3016
|
-
if (entry.type ===
|
|
3016
|
+
if (entry.type === _FormattingElementList.ELEMENT_ENTRY && entry.element === element3) {
|
|
3017
3017
|
return entry;
|
|
3018
3018
|
}
|
|
3019
3019
|
}
|