@gmb/bitmark-parser-generator 3.23.0 → 3.25.0
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/browser/bitmark-parser-generator.min.js +1 -1
- package/dist/browser/bundle-report.html +2 -2
- package/dist/cjs/BitmarkParserGenerator.js +10 -2
- package/dist/cjs/BitmarkParserGenerator.js.map +1 -1
- package/dist/cjs/ast/BaseBuilder.js +4 -0
- package/dist/cjs/ast/BaseBuilder.js.map +1 -1
- package/dist/cjs/ast/Builder.js +11 -7
- package/dist/cjs/ast/Builder.js.map +1 -1
- package/dist/cjs/breakscaping/Breakscape.js +185 -128
- package/dist/cjs/breakscaping/Breakscape.js.map +1 -1
- package/dist/cjs/config/raw/bits.js +11 -0
- package/dist/cjs/config/raw/bits.js.map +1 -1
- package/dist/cjs/config/raw/groups.js +5 -0
- package/dist/cjs/config/raw/groups.js.map +1 -1
- package/dist/cjs/config/raw/properties.js +4 -0
- package/dist/cjs/config/raw/properties.js.map +1 -1
- package/dist/cjs/generated/build-info.js +1 -1
- package/dist/cjs/generated/parser/text/text-peggy-parser.js +317 -296
- package/dist/cjs/generated/parser/text/text-peggy-parser.js.map +1 -1
- package/dist/cjs/generator/bitmark/BitmarkGenerator.js +276 -166
- package/dist/cjs/generator/bitmark/BitmarkGenerator.js.map +1 -1
- package/dist/cjs/generator/json/JsonGenerator.js +10 -7
- package/dist/cjs/generator/json/JsonGenerator.js.map +1 -1
- package/dist/cjs/generator/text/TextGenerator.js +42 -12
- package/dist/cjs/generator/text/TextGenerator.js.map +1 -1
- package/dist/cjs/model/ast/NodeType.js +2 -0
- package/dist/cjs/model/ast/NodeType.js.map +1 -1
- package/dist/cjs/model/config/enum/PropertyConfigKey.js +1 -0
- package/dist/cjs/model/config/enum/PropertyConfigKey.js.map +1 -1
- package/dist/cjs/model/enum/BitType.js +2 -0
- package/dist/cjs/model/enum/BitType.js.map +1 -1
- package/dist/cjs/model/enum/TextFormat.js +16 -7
- package/dist/cjs/model/enum/TextFormat.js.map +1 -1
- package/dist/cjs/model/enum/TextLocation.js +15 -0
- package/dist/cjs/model/enum/TextLocation.js.map +1 -0
- package/dist/cjs/parser/bitmark/peg/BitmarkPegParserHelper.js +5 -2
- package/dist/cjs/parser/bitmark/peg/BitmarkPegParserHelper.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/BitmarkPegParserProcessor.js +5 -2
- package/dist/cjs/parser/bitmark/peg/BitmarkPegParserProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/BodyContentProcessor.js +4 -0
- package/dist/cjs/parser/bitmark/peg/contentProcessors/BodyContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/BookChainContentProcessor.js +3 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/BookChainContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/CardContentProcessor.js +1 -2
- package/dist/cjs/parser/bitmark/peg/contentProcessors/CardContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/ClozeTagContentProcessor.js +3 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/ClozeTagContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/DefaultTagContentProcessor.js +17 -5
- package/dist/cjs/parser/bitmark/peg/contentProcessors/DefaultTagContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/ExampleTagContentProcessor.js +8 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/ExampleTagContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/FooterContentProcessor.js +3 -0
- package/dist/cjs/parser/bitmark/peg/contentProcessors/FooterContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/ImageSourceChainContentProcessor.js +3 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/ImageSourceChainContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/MarkConfigChainContentProcessor.js +3 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/MarkConfigChainContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/MarkTagContentProcessor.js +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/MarkTagContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/PersonChainContentProcessor.js +4 -2
- package/dist/cjs/parser/bitmark/peg/contentProcessors/PersonChainContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/PropertyContentProcessor.js +11 -5
- package/dist/cjs/parser/bitmark/peg/contentProcessors/PropertyContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/ReferenceTagContentProcessor.js +5 -2
- package/dist/cjs/parser/bitmark/peg/contentProcessors/ReferenceTagContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/ResourceContentProcessor.js +7 -2
- package/dist/cjs/parser/bitmark/peg/contentProcessors/ResourceContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/TechnicalTermChainContentProcessor.js +3 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/TechnicalTermChainContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/TrueFalseTagContentProcessor.js +3 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/TrueFalseTagContentProcessor.js.map +1 -1
- package/dist/cjs/parser/text/TextParser.js +0 -15
- package/dist/cjs/parser/text/TextParser.js.map +1 -1
- package/dist/esm/BitmarkParserGenerator.js +10 -2
- package/dist/esm/BitmarkParserGenerator.js.map +1 -1
- package/dist/esm/ast/BaseBuilder.js +4 -0
- package/dist/esm/ast/BaseBuilder.js.map +1 -1
- package/dist/esm/ast/Builder.js +11 -7
- package/dist/esm/ast/Builder.js.map +1 -1
- package/dist/esm/breakscaping/Breakscape.js +185 -128
- package/dist/esm/breakscaping/Breakscape.js.map +1 -1
- package/dist/esm/config/raw/bits.js +11 -0
- package/dist/esm/config/raw/bits.js.map +1 -1
- package/dist/esm/config/raw/groups.js +5 -0
- package/dist/esm/config/raw/groups.js.map +1 -1
- package/dist/esm/config/raw/properties.js +4 -0
- package/dist/esm/config/raw/properties.js.map +1 -1
- package/dist/esm/generated/build-info.js +1 -1
- package/dist/esm/generated/parser/text/text-peggy-parser.js +317 -296
- package/dist/esm/generated/parser/text/text-peggy-parser.js.map +1 -1
- package/dist/esm/generator/bitmark/BitmarkGenerator.js +276 -166
- package/dist/esm/generator/bitmark/BitmarkGenerator.js.map +1 -1
- package/dist/esm/generator/json/JsonGenerator.js +10 -7
- package/dist/esm/generator/json/JsonGenerator.js.map +1 -1
- package/dist/esm/generator/text/TextGenerator.js +42 -12
- package/dist/esm/generator/text/TextGenerator.js.map +1 -1
- package/dist/esm/model/ast/NodeType.js +2 -0
- package/dist/esm/model/ast/NodeType.js.map +1 -1
- package/dist/esm/model/config/enum/PropertyConfigKey.js +1 -0
- package/dist/esm/model/config/enum/PropertyConfigKey.js.map +1 -1
- package/dist/esm/model/enum/BitType.js +2 -0
- package/dist/esm/model/enum/BitType.js.map +1 -1
- package/dist/esm/model/enum/TextFormat.js +16 -7
- package/dist/esm/model/enum/TextFormat.js.map +1 -1
- package/dist/esm/model/enum/TextLocation.js +12 -0
- package/dist/esm/model/enum/TextLocation.js.map +1 -0
- package/dist/esm/parser/bitmark/peg/BitmarkPegParserHelper.js +5 -2
- package/dist/esm/parser/bitmark/peg/BitmarkPegParserHelper.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/BitmarkPegParserProcessor.js +5 -2
- package/dist/esm/parser/bitmark/peg/BitmarkPegParserProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/BodyContentProcessor.js +4 -0
- package/dist/esm/parser/bitmark/peg/contentProcessors/BodyContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/BookChainContentProcessor.js +3 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/BookChainContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/CardContentProcessor.js +1 -2
- package/dist/esm/parser/bitmark/peg/contentProcessors/CardContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/ClozeTagContentProcessor.js +3 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/ClozeTagContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/DefaultTagContentProcessor.js +17 -5
- package/dist/esm/parser/bitmark/peg/contentProcessors/DefaultTagContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/ExampleTagContentProcessor.js +8 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/ExampleTagContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/FooterContentProcessor.js +3 -0
- package/dist/esm/parser/bitmark/peg/contentProcessors/FooterContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/ImageSourceChainContentProcessor.js +3 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/ImageSourceChainContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/MarkConfigChainContentProcessor.js +3 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/MarkConfigChainContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/MarkTagContentProcessor.js +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/MarkTagContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/PersonChainContentProcessor.js +4 -2
- package/dist/esm/parser/bitmark/peg/contentProcessors/PersonChainContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/PropertyContentProcessor.js +11 -5
- package/dist/esm/parser/bitmark/peg/contentProcessors/PropertyContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/ReferenceTagContentProcessor.js +5 -2
- package/dist/esm/parser/bitmark/peg/contentProcessors/ReferenceTagContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/ResourceContentProcessor.js +7 -2
- package/dist/esm/parser/bitmark/peg/contentProcessors/ResourceContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/TechnicalTermChainContentProcessor.js +3 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/TechnicalTermChainContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/TrueFalseTagContentProcessor.js +3 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/TrueFalseTagContentProcessor.js.map +1 -1
- package/dist/esm/parser/text/TextParser.js +0 -15
- package/dist/esm/parser/text/TextParser.js.map +1 -1
- package/dist/types/BitmarkParserGenerator.d.ts +13 -0
- package/dist/types/BitmarkParserGenerator.d.ts.map +1 -1
- package/dist/types/ast/BaseBuilder.d.ts.map +1 -1
- package/dist/types/ast/Builder.d.ts +1 -0
- package/dist/types/ast/Builder.d.ts.map +1 -1
- package/dist/types/breakscaping/Breakscape.d.ts +23 -1
- package/dist/types/breakscaping/Breakscape.d.ts.map +1 -1
- package/dist/types/config/raw/bits.d.ts.map +1 -1
- package/dist/types/config/raw/groups.d.ts.map +1 -1
- package/dist/types/config/raw/properties.d.ts.map +1 -1
- package/dist/types/generated/parser/text/text-peggy-parser.d.ts.map +1 -1
- package/dist/types/generator/bitmark/BitmarkGenerator.d.ts +61 -18
- package/dist/types/generator/bitmark/BitmarkGenerator.d.ts.map +1 -1
- package/dist/types/generator/json/JsonGenerator.d.ts.map +1 -1
- package/dist/types/generator/text/TextGenerator.d.ts +9 -2
- package/dist/types/generator/text/TextGenerator.d.ts.map +1 -1
- package/dist/types/model/ast/NodeType.d.ts +4 -0
- package/dist/types/model/ast/NodeType.d.ts.map +1 -1
- package/dist/types/model/ast/Nodes.d.ts +1 -0
- package/dist/types/model/ast/Nodes.d.ts.map +1 -1
- package/dist/types/model/config/enum/ConfigKey.d.ts +2 -0
- package/dist/types/model/config/enum/ConfigKey.d.ts.map +1 -1
- package/dist/types/model/config/enum/PropertyConfigKey.d.ts +3 -0
- package/dist/types/model/config/enum/PropertyConfigKey.d.ts.map +1 -1
- package/dist/types/model/enum/BitType.d.ts +4 -0
- package/dist/types/model/enum/BitType.d.ts.map +1 -1
- package/dist/types/model/enum/PropertyTag.d.ts +2 -0
- package/dist/types/model/enum/PropertyTag.d.ts.map +1 -1
- package/dist/types/model/enum/TextFormat.d.ts +0 -2
- package/dist/types/model/enum/TextFormat.d.ts.map +1 -1
- package/dist/types/model/enum/TextLocation.d.ts +16 -0
- package/dist/types/model/enum/TextLocation.d.ts.map +1 -0
- package/dist/types/model/json/BitJson.d.ts +4 -3
- package/dist/types/model/json/BitJson.d.ts.map +1 -1
- package/dist/types/parser/bitmark/peg/BitmarkPegParserHelper.d.ts.map +1 -1
- package/dist/types/parser/bitmark/peg/BitmarkPegParserProcessor.d.ts.map +1 -1
- package/dist/types/parser/bitmark/peg/contentProcessors/BodyContentProcessor.d.ts.map +1 -1
- package/dist/types/parser/bitmark/peg/contentProcessors/BookChainContentProcessor.d.ts.map +1 -1
- package/dist/types/parser/bitmark/peg/contentProcessors/CardContentProcessor.d.ts.map +1 -1
- package/dist/types/parser/bitmark/peg/contentProcessors/ClozeTagContentProcessor.d.ts.map +1 -1
- package/dist/types/parser/bitmark/peg/contentProcessors/DefaultTagContentProcessor.d.ts.map +1 -1
- package/dist/types/parser/bitmark/peg/contentProcessors/ExampleTagContentProcessor.d.ts.map +1 -1
- package/dist/types/parser/bitmark/peg/contentProcessors/FooterContentProcessor.d.ts.map +1 -1
- package/dist/types/parser/bitmark/peg/contentProcessors/ImageSourceChainContentProcessor.d.ts.map +1 -1
- package/dist/types/parser/bitmark/peg/contentProcessors/MarkConfigChainContentProcessor.d.ts.map +1 -1
- package/dist/types/parser/bitmark/peg/contentProcessors/PersonChainContentProcessor.d.ts.map +1 -1
- package/dist/types/parser/bitmark/peg/contentProcessors/PropertyContentProcessor.d.ts.map +1 -1
- package/dist/types/parser/bitmark/peg/contentProcessors/ReferenceTagContentProcessor.d.ts.map +1 -1
- package/dist/types/parser/bitmark/peg/contentProcessors/ResourceContentProcessor.d.ts.map +1 -1
- package/dist/types/parser/bitmark/peg/contentProcessors/TechnicalTermChainContentProcessor.d.ts.map +1 -1
- package/dist/types/parser/bitmark/peg/contentProcessors/TrueFalseTagContentProcessor.d.ts.map +1 -1
- package/dist/types/parser/text/TextParser.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -2,10 +2,15 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Breakscape = void 0;
|
|
4
4
|
const TextFormat_1 = require("../model/enum/TextFormat");
|
|
5
|
+
const TextLocation_1 = require("../model/enum/TextLocation");
|
|
5
6
|
const StringUtils_1 = require("../utils/StringUtils");
|
|
6
7
|
/**
|
|
7
8
|
* Utility class for breakscaping strings.
|
|
8
9
|
*
|
|
10
|
+
* ============
|
|
11
|
+
* Breakscaping
|
|
12
|
+
* ============
|
|
13
|
+
*
|
|
9
14
|
* Breakscaping is the process of escaping certain character sequences in a string so that they are not interpreted as
|
|
10
15
|
* special sequences by the parser.
|
|
11
16
|
*
|
|
@@ -15,108 +20,137 @@ const StringUtils_1 = require("../utils/StringUtils");
|
|
|
15
20
|
* The special character is ^
|
|
16
21
|
* To include the special character in a text which is breakscaped, use ^^ (once), ^^^ (twice), etc.
|
|
17
22
|
*
|
|
18
|
-
* Any sequence can be breakscaped by breaking it with a ^ character.
|
|
23
|
+
* Any sequence can be breakscaped by breaking it with a single ^ character.
|
|
19
24
|
*
|
|
20
|
-
*
|
|
21
|
-
* - hat: ^ ==>
|
|
22
|
-
* - hat: ^^ ==> ^
|
|
23
|
-
* - hat: ^..N ==> ^..N-1
|
|
25
|
+
* When breakscaping text programmatically, the following rules apply to keep the breakscaping to a minimum:
|
|
24
26
|
*
|
|
25
27
|
* The following breakscaping rules are applied when breakscaping text:
|
|
26
|
-
*
|
|
27
|
-
* - hat:
|
|
28
|
-
* - hat:
|
|
29
|
-
* -
|
|
30
|
-
* -
|
|
31
|
-
* -
|
|
32
|
-
* -
|
|
33
|
-
* -
|
|
34
|
-
* -
|
|
35
|
-
* -
|
|
36
|
-
* -
|
|
37
|
-
* -
|
|
38
|
-
* -
|
|
39
|
-
* -
|
|
40
|
-
* -
|
|
41
|
-
* -
|
|
42
|
-
* -
|
|
43
|
-
* -
|
|
44
|
-
* -
|
|
45
|
-
* -
|
|
46
|
-
* -
|
|
47
|
-
*
|
|
48
|
-
* - start of
|
|
49
|
-
* - start of
|
|
50
|
-
* - start of
|
|
51
|
-
* - start of
|
|
52
|
-
* - start of
|
|
53
|
-
* - start of
|
|
54
|
-
* - start of
|
|
55
|
-
* - start of
|
|
56
|
-
* - start of
|
|
57
|
-
* - start of
|
|
58
|
-
* - start of
|
|
59
|
-
* - start of
|
|
60
|
-
* - start of
|
|
61
|
-
* -
|
|
28
|
+
* <item> <from> <to> <textFormat>
|
|
29
|
+
* - hat: ^ ==> ^^ [--/++/+]
|
|
30
|
+
* - hat: ^^ ==> ^^^ [--/++/+]
|
|
31
|
+
* - hat: ^..N ==> ^..N+1 [--/++/+]
|
|
32
|
+
* - inline: == ==> =^= [--/++/+]
|
|
33
|
+
* - bold: ** ==> *^* [--/++/+]
|
|
34
|
+
* - light: `` ==> `^` [--/++/+]
|
|
35
|
+
* - italic: __ ==> _^_ [--/++/+]
|
|
36
|
+
* - highlight: !! ==> !^! [--/++/+]
|
|
37
|
+
* - title block: (SOL)[##]#(space) ==> (SOL)[##]#^(space) [++] <== not in tag
|
|
38
|
+
* - new block: (SOL)|(WS EOL) ==> (SOL)|^(WS EOL) [++] <== not in tag
|
|
39
|
+
* - code block: (SOL)|code(:type) ==> (SOL)|^code(:type) [++] <== not in tag
|
|
40
|
+
* - image block: (SOL)|image:(url) ==> (SOL)|^image:(url) [++] <== not in tag
|
|
41
|
+
* - bullet list: (SOL)•(space) ==> (SOL)•^(space) [++] <== not in tag
|
|
42
|
+
* - simple list: (SOL)•_(space) ==> (SOL)•^_(space) [++] <== not in tag
|
|
43
|
+
* - ordered list (numeric): (SOL)•<numbers>(space) ==> (SOL)•^<numbers>(space) [++] <== not in tag
|
|
44
|
+
* - ordered list: (roman,lower) (SOL)•<numbers>i(space) ==> (SOL)•^<numbers>i(space) [++] <== not in tag
|
|
45
|
+
* - ordered list: (roman,upper) (SOL)•<numbers>I(space) ==> (SOL)•^<numbers>I(space) [++] <== not in tag
|
|
46
|
+
* - ordered list: (SOL)•<letters>(space) ==> (SOL)•^<letters>(space) [++] <== not in tag
|
|
47
|
+
* - tag list +: (SOL)•+(space) ==> (SOL)•^+(space) [++] <== not in tag
|
|
48
|
+
* - tag list -: (SOL)•-(space) ==> (SOL)•^-(space) [++] <== not in tag
|
|
49
|
+
*
|
|
50
|
+
* - start of bit: [. ==> [^. [--/++ && body]
|
|
51
|
+
* - start of property: [@ ==> [^@ [--/++ && body]
|
|
52
|
+
* - start of title: [# ==> [^# [--/++ && body]
|
|
53
|
+
* - start of anchor: [▼ ==> [^▼ [--/++ && body]
|
|
54
|
+
* - start of reference: [► ==> [^► [--/++ && body]
|
|
55
|
+
* - start of item/lead: [% ==> [^% [--/++ && body]
|
|
56
|
+
* - start of instruction: [! ==> [^! [--/++ && body]
|
|
57
|
+
* - start of hint: [? ==> [^? [--/++ && body]
|
|
58
|
+
* - start of true statement: [+ ==> [^+ [--/++ && body]
|
|
59
|
+
* - start of false statement: [- ==> [^- [--/++ && body]
|
|
60
|
+
* - start of sample solution: [$ ==> [^$ [--/++ && body]
|
|
61
|
+
* - start of gap: [_ ==> [^_ [--/++ && body]
|
|
62
|
+
* - start of mark: [= ==> [^= [--/++ && body]
|
|
63
|
+
* - start of resource: [& ==> [^& [--/++ && body]
|
|
64
|
+
* - old plain text divider: $$$$ ==> $^$$$ [--/++ && body]
|
|
65
|
+
* - old footer divider: ~~~~ ==> ~^~~~ [--/++ && body]
|
|
66
|
+
*
|
|
67
|
+
* - start of bit: (SOL)[. ==> (SOL)[^. [plain && body]
|
|
68
|
+
* - start of bit: (SOL)[^. ==> (SOL)[^^. [plain && body]
|
|
69
|
+
* - start of bit: (SOL)[^..N. ==> (SOL)[^..N+1. [plain && body]
|
|
70
|
+
*
|
|
71
|
+
* - end of tag: ] ==> ^] [--/++/+/plain && tag]
|
|
72
|
+
*
|
|
73
|
+
*
|
|
74
|
+
* ==============
|
|
75
|
+
* Unbreakscaping
|
|
76
|
+
* ==============
|
|
62
77
|
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
78
|
+
* Unbreakscaping is the process of removing the breakscaping characters from a string.
|
|
79
|
+
* It is the opposite of breakscaping.
|
|
65
80
|
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
81
|
+
* In all text but plain text:
|
|
82
|
+
* ^ is always removed/reduced wherever it is found.
|
|
83
|
+
* ^^ is always needed to represent a ^.
|
|
84
|
+
*
|
|
85
|
+
* In plain text:
|
|
86
|
+
* ^ is only removed/reduced when it would break the start of a bit.
|
|
87
|
+
*
|
|
88
|
+
* The following unbreakscaping rules apply when unbreakscaping text:
|
|
89
|
+
* <item> <from> <to> <textFormat>
|
|
90
|
+
* - hat: ^ ==> [--/++/+]
|
|
91
|
+
* - hat: ^^ ==> ^ [--/++/+]
|
|
92
|
+
* - hat: ^..N ==> ^..N-1 [--/++/+]
|
|
93
|
+
*
|
|
94
|
+
* - start of bit: (SOL)[^. ==> (SOL)[. [plain && body]
|
|
95
|
+
* - start of bit: (SOL)[^^. ==> (SOL)[^. [plain && body]
|
|
96
|
+
* - start of bit: (SOL)[^..N. ==> (SOL)[^..N-1. [plain && body]
|
|
70
97
|
*
|
|
71
|
-
* The following breakscaping rules are applied when breakscaping plain text:
|
|
72
|
-
* - start of bit: <line start>[. ==> <line start>[^.
|
|
73
|
-
* - start of bit: <line start>[^. ==> <line start>[^^.
|
|
74
|
-
* - start of bit: <line start>[^..N. ==> <line start>[^..N+1.
|
|
75
98
|
*/
|
|
76
99
|
//
|
|
77
100
|
// Breakscaping
|
|
78
101
|
//
|
|
79
|
-
const REGEX_MARKS = /([*`_!=])(?=\1)/; // $1^
|
|
80
|
-
const REGEX_BLOCKS = /^(\|)(code[\s]*|code:|image:|[\s]*$)/; // $2^$3
|
|
81
|
-
const REGEX_TITLE_BLOCKS = /^([#]{1,3})([^\S\r\n]+)/; // $4^$5
|
|
82
|
-
const REGEX_LIST_BLOCKS = /^(•)([0-9]+[iI]*|[a-zA-Z]{1}|_|\+|-|)([^\S\r\n]+)/; // $6^$7$8
|
|
83
|
-
const REGEX_START_OF_TAG = /(\[)([.@#▼►%!?+\-$_=&])/; // $9^$10
|
|
84
|
-
const REGEX_FOOTER_DIVIDER = /^(~)(~~~
|
|
85
|
-
const REGEX_PLAIN_TEXT_DIVIDER = /^(\$)(\$\$\$
|
|
86
|
-
const REGEX_END_OF_TAG = /(\^*])/; // ^$
|
|
87
|
-
const
|
|
88
|
-
const
|
|
89
|
-
const
|
|
90
|
-
const
|
|
91
|
-
const
|
|
92
|
-
const
|
|
93
|
-
const
|
|
94
|
-
|
|
95
|
-
const
|
|
96
|
-
const
|
|
97
|
-
|
|
98
|
-
const
|
|
99
|
-
const
|
|
100
|
-
|
|
101
|
-
const
|
|
102
|
-
const
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
102
|
+
const REGEX_MARKS = /([*`_!=])(?=\1)/; // BM_TAG: $1^ --BODY: $1^ ++BODY: $1^
|
|
103
|
+
const REGEX_BLOCKS = /^(\|)(code[\s]*|code:|image:|[\s]*$)/; // ++BODY: $2^$3
|
|
104
|
+
const REGEX_TITLE_BLOCKS = /^([#]{1,3})([^\S\r\n]+)/; // ++BODY: $4^$5
|
|
105
|
+
const REGEX_LIST_BLOCKS = /^(•)([0-9]+[iI]*|[a-zA-Z]{1}|_|\+|-|)([^\S\r\n]+)/; // ++BODY: $6^$7$8
|
|
106
|
+
const REGEX_START_OF_TAG = /(\[)([.@#▼►%!?+\-$_=&])/; // --BODY: $2^$3 ++BODY: $9^$10
|
|
107
|
+
const REGEX_FOOTER_DIVIDER = /^(~)(~~~[ \t]*)$/; // --BODY: $4^$5 ++BODY: $11^$12
|
|
108
|
+
const REGEX_PLAIN_TEXT_DIVIDER = /^(\$)(\$\$\$[ \t]*)$/; // --BODY: $6^$7 ++BODY: $13^$14
|
|
109
|
+
const REGEX_END_OF_TAG = /(\^*])/; // BM_TAG: ^$2 PLAIN_TAG: ^$1
|
|
110
|
+
const REGEX_BIT_START = /^(\[)(\^*)(\.)/; // PLAIN_BODY: $1^$2$3
|
|
111
|
+
const REGEX_HATS = /(\^+)/; // BM_TAG: $3^ PLAIN_TAG: $2^ --BODY: ^$8 ++BODY: $15^ // Must be last
|
|
112
|
+
const BREAKSCAPE_BITMARK_TAG_REGEX_SOURCE = `${REGEX_MARKS.source}|${REGEX_END_OF_TAG.source}|${REGEX_HATS.source}`;
|
|
113
|
+
const BREAKSCAPE_PLAIN_TAG_REGEX_SOURCE = `${REGEX_END_OF_TAG.source}|${REGEX_HATS.source}`;
|
|
114
|
+
const BREAKSCAPE_MINUSMINUS_BODY_REGEX_SOURCE = `${REGEX_MARKS.source}|${REGEX_START_OF_TAG.source}|${REGEX_FOOTER_DIVIDER.source}|${REGEX_PLAIN_TEXT_DIVIDER.source}|${REGEX_HATS.source}`;
|
|
115
|
+
const BREAKSCAPE_PLUSPLUS_BODY_REGEX_SOURCE = `${REGEX_MARKS.source}|${REGEX_BLOCKS.source}|${REGEX_TITLE_BLOCKS.source}|${REGEX_LIST_BLOCKS.source}|${REGEX_START_OF_TAG.source}|${REGEX_FOOTER_DIVIDER.source}|${REGEX_PLAIN_TEXT_DIVIDER.source}|${REGEX_HATS.source}`;
|
|
116
|
+
const BREAKSCAPE_PLAIN_BODY_REGEX_SOURCE = `${REGEX_BIT_START.source}`;
|
|
117
|
+
// Breakscape regex for --/++/+ in tags
|
|
118
|
+
const BREAKSCAPE_BITMARK_TAG_REGEX = new RegExp(BREAKSCAPE_BITMARK_TAG_REGEX_SOURCE, 'gm');
|
|
119
|
+
const BREAKSCAPE_BITMARK_TAG_REGEX_REPLACER = '$1$3^$2';
|
|
120
|
+
// Breakscape regex for plain text in tags
|
|
121
|
+
const BREAKSCAPE_PLAIN_TAG_REGEX = new RegExp(BREAKSCAPE_PLAIN_TAG_REGEX_SOURCE, 'gm');
|
|
122
|
+
const BREAKSCAPE_PLAIN_TAG_REGEX_REPLACER = '$2^$1';
|
|
123
|
+
// Breakscape regex for --/+ in body
|
|
124
|
+
const BREAKSCAPE_MINUSMINUS_BODY_REGEX = new RegExp(BREAKSCAPE_MINUSMINUS_BODY_REGEX_SOURCE, 'gm');
|
|
125
|
+
const BREAKSCAPE_MINUSMINUS_BODY_REGEX_REPLACER = '$1$2$4$6^$3$5$7$8';
|
|
126
|
+
// Breakscape regex for ++ in body
|
|
127
|
+
const BREAKSCAPE_PLUSPLUS_BODY_REGEX = new RegExp(BREAKSCAPE_PLUSPLUS_BODY_REGEX_SOURCE, 'gm');
|
|
128
|
+
const BREAKSCAPE_PLUSPLUS_BODY_REGEX_REPLACER = '$1$2$4$6$9$11$13$15^$3$5$7$8$10$12$14';
|
|
129
|
+
// Breakscape regex for plain text in body
|
|
130
|
+
const BREAKSCAPE_PLAIN_BODY_REGEX = new RegExp(BREAKSCAPE_PLAIN_BODY_REGEX_SOURCE, 'gm');
|
|
131
|
+
const BREAKSCAPE_PLAIN_BODY_REGEX_REPLACER = '$1^$2$3';
|
|
132
|
+
// Breakscape regex for v2 tag. Not required, same as BREAKSCAPE_PLAIN_TAG_REGEX
|
|
133
|
+
// const BREAKSCAPE_V2_TAG_REGEX = new RegExp('^(\\^*])|(\\^+)', 'gm');
|
|
134
|
+
// const BREAKSCAPE_V2_TAG_REGEX_REPLACER = '$2^$1';
|
|
135
|
+
// Breakscape regex for v2 body
|
|
136
|
+
const BREAKSCAPE_V2_BODY_REGEX = new RegExp('^(?:(\\[)(\\^*)(\\.))|(\\^+)', 'gm');
|
|
137
|
+
const BREAKSCAPE_V2_BODY_REGEX_REPLACER = '$1$4^$2$3';
|
|
138
|
+
// Unbreakscape regex for everything but plain text in the body
|
|
106
139
|
const UNBREAKSCAPE_REGEX = new RegExp('\\^([\\^]*)', 'gm');
|
|
107
140
|
const UNBREAKSCAPE_REGEX_REPLACER = '$1';
|
|
108
|
-
|
|
109
|
-
const UNBREAKSCAPE_TAG_REPLACER = '$1$2';
|
|
141
|
+
// Unbreakscape regex for plain text in the body
|
|
110
142
|
const UNBREAKSCAPE_PLAIN_IN_BODY_REGEX = new RegExp('^(\\[)\\^(\\^*)(\\.)', 'gm');
|
|
111
143
|
const UNBREAKSCAPE_PLAIN_IN_BODY_REGEX_REPLACER = '$1$2$3';
|
|
112
144
|
// Regex explanation:
|
|
113
145
|
// - match a single | or • or # character at the start of a line and capture in group 1
|
|
114
146
|
// This will capture all new block characters within the code text.
|
|
115
147
|
// Replace with group 1, ^
|
|
148
|
+
// TODO: Not sure this is used any longer. #code blocks are not separate bits as far as I am aware?
|
|
116
149
|
const BREAKSCAPE_CODE_REGEX = new RegExp('^(\\||•|#)', 'gm');
|
|
117
150
|
const BREAKSCAPE_CODE_REGEX_REPLACER = '$1^';
|
|
118
151
|
const DEFAULT_BREAKSCAPE_OPTIONS = {
|
|
119
152
|
textFormat: TextFormat_1.TextFormat.bitmarkMinusMinus,
|
|
153
|
+
textLocation: TextLocation_1.TextLocation.body,
|
|
120
154
|
};
|
|
121
155
|
class Breakscape {
|
|
122
156
|
constructor() {
|
|
@@ -135,50 +169,16 @@ class Breakscape {
|
|
|
135
169
|
if (val == null)
|
|
136
170
|
return val;
|
|
137
171
|
const opts = Object.assign({}, DEFAULT_BREAKSCAPE_OPTIONS, options);
|
|
172
|
+
// Select the correct regex and replacer for the text format and location
|
|
173
|
+
const { regex, replacer } = this.selectBreakscapeRegexAndReplacer(opts.textFormat, opts.textLocation, opts.v2);
|
|
138
174
|
const breakscapeStr = (str) => {
|
|
139
175
|
if (!str)
|
|
140
176
|
return str;
|
|
141
|
-
let regex = BREAKSCAPE_PLAIN_IN_BODY_REGEX;
|
|
142
|
-
let replacer = BREAKSCAPE_PLAIN_IN_BODY_REGEX_REPLACER;
|
|
143
|
-
if (opts.textFormat === TextFormat_1.TextFormat.tag) {
|
|
144
|
-
regex = BREAKSCAPE_TAG_REGEX;
|
|
145
|
-
replacer = BREAKSCAPE_TAG_REPLACER;
|
|
146
|
-
}
|
|
147
|
-
else if (opts.textFormat === TextFormat_1.TextFormat.bitmarkMinusMinus) {
|
|
148
|
-
if (opts.v2) {
|
|
149
|
-
// Hack for v2 breakscaping
|
|
150
|
-
regex = BREAKSCAPE_V2_REGEX;
|
|
151
|
-
replacer = BREAKSCAPE_V2_REGEX_REPLACER;
|
|
152
|
-
}
|
|
153
|
-
else {
|
|
154
|
-
regex = BREAKSCAPE_MINUSMINUS_REGEX;
|
|
155
|
-
replacer = BREAKSCAPE_MINUSMINUS_REGEX_REPLACER;
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
else if (opts.textFormat === TextFormat_1.TextFormat.bitmarkPlusPlus) {
|
|
159
|
-
if (opts.v2) {
|
|
160
|
-
// Hack for v2 breakscaping
|
|
161
|
-
regex = BREAKSCAPE_V2_REGEX;
|
|
162
|
-
replacer = BREAKSCAPE_V2_REGEX_REPLACER;
|
|
163
|
-
}
|
|
164
|
-
else {
|
|
165
|
-
regex = BREAKSCAPE_PLUSPLUS_REGEX;
|
|
166
|
-
replacer = BREAKSCAPE_PLUSPLUS_REGEX_REPLACER;
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
177
|
str = str.replace(regex, replacer);
|
|
170
|
-
// Ends - ensures that the start and end of the string are breakscaped in cases where the ends could otherwise
|
|
171
|
-
// come together to form a recognized sequence
|
|
172
|
-
// TODO: this should not be needed in the future
|
|
173
|
-
if (!opts.v2) {
|
|
174
|
-
if (opts.textFormat === TextFormat_1.TextFormat.bitmarkMinusMinus || opts.textFormat === TextFormat_1.TextFormat.bitmarkPlusPlus) {
|
|
175
|
-
str = str.replace(BREAKSCAPE_ENDS_REGEX, BREAKSCAPE_ENDS_REGEX_REPLACER);
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
178
|
return str;
|
|
179
179
|
};
|
|
180
180
|
if (Array.isArray(val)) {
|
|
181
|
-
const newVal = opts.modifyArray ? val :
|
|
181
|
+
const newVal = opts.modifyArray ? val : new Array(val.length);
|
|
182
182
|
for (let i = 0, len = val.length; i < len; i++) {
|
|
183
183
|
const v = val[i];
|
|
184
184
|
if (StringUtils_1.StringUtils.isString(v)) {
|
|
@@ -204,24 +204,16 @@ class Breakscape {
|
|
|
204
204
|
if (val == null)
|
|
205
205
|
return val;
|
|
206
206
|
const opts = Object.assign({}, DEFAULT_BREAKSCAPE_OPTIONS, options);
|
|
207
|
+
// Select the correct regex and replacer for the text format and location
|
|
208
|
+
const { regex, replacer } = this.selectUnbreakscapeRegexAndReplacer(opts.textFormat, opts.textLocation);
|
|
207
209
|
const unbreakscapeStr = (str) => {
|
|
208
210
|
if (!str)
|
|
209
211
|
return str;
|
|
210
|
-
let regex = UNBREAKSCAPE_PLAIN_IN_BODY_REGEX;
|
|
211
|
-
let replacer = UNBREAKSCAPE_PLAIN_IN_BODY_REGEX_REPLACER;
|
|
212
|
-
if (opts.textFormat === TextFormat_1.TextFormat.tag) {
|
|
213
|
-
regex = UNBREAKSCAPE_TAG_REGEX;
|
|
214
|
-
replacer = UNBREAKSCAPE_TAG_REPLACER;
|
|
215
|
-
}
|
|
216
|
-
else if (opts.textFormat === TextFormat_1.TextFormat.bitmarkMinusMinus || opts.textFormat === TextFormat_1.TextFormat.bitmarkPlusPlus) {
|
|
217
|
-
regex = UNBREAKSCAPE_REGEX;
|
|
218
|
-
replacer = UNBREAKSCAPE_REGEX_REPLACER;
|
|
219
|
-
}
|
|
220
212
|
str = str.replace(regex, replacer);
|
|
221
213
|
return str;
|
|
222
214
|
};
|
|
223
215
|
if (Array.isArray(val)) {
|
|
224
|
-
const newVal = opts.modifyArray ? val :
|
|
216
|
+
const newVal = opts.modifyArray ? val : new Array(val.length);
|
|
225
217
|
for (let i = 0, len = val.length; i < len; i++) {
|
|
226
218
|
const v = val[i];
|
|
227
219
|
if (StringUtils_1.StringUtils.isString(v)) {
|
|
@@ -270,6 +262,71 @@ class Breakscape {
|
|
|
270
262
|
}
|
|
271
263
|
return val;
|
|
272
264
|
}
|
|
265
|
+
/**
|
|
266
|
+
* For breakscaping, select the correct regex and replacer for the text format and location.
|
|
267
|
+
*
|
|
268
|
+
* @param textFormat the format of the text
|
|
269
|
+
* @param textLocation the location of the text
|
|
270
|
+
* @param v2 if true, use v2 breakscaping
|
|
271
|
+
* @returns the regex and replacer
|
|
272
|
+
*/
|
|
273
|
+
selectBreakscapeRegexAndReplacer(textFormat, textLocation, v2) {
|
|
274
|
+
let regex;
|
|
275
|
+
let replacer;
|
|
276
|
+
if (textLocation === TextLocation_1.TextLocation.tag) {
|
|
277
|
+
regex = BREAKSCAPE_PLAIN_TAG_REGEX;
|
|
278
|
+
replacer = BREAKSCAPE_PLAIN_TAG_REGEX_REPLACER;
|
|
279
|
+
if (!v2 && (textFormat === TextFormat_1.TextFormat.bitmarkMinusMinus || textFormat === TextFormat_1.TextFormat.bitmarkPlusPlus)) {
|
|
280
|
+
regex = BREAKSCAPE_BITMARK_TAG_REGEX;
|
|
281
|
+
replacer = BREAKSCAPE_BITMARK_TAG_REGEX_REPLACER;
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
else {
|
|
285
|
+
// if (textLocation === TextLocation.body) {
|
|
286
|
+
regex = BREAKSCAPE_PLAIN_BODY_REGEX;
|
|
287
|
+
replacer = BREAKSCAPE_PLAIN_BODY_REGEX_REPLACER;
|
|
288
|
+
if (textFormat === TextFormat_1.TextFormat.bitmarkMinusMinus) {
|
|
289
|
+
if (v2) {
|
|
290
|
+
// Hack for v2 breakscaping (still needed??)
|
|
291
|
+
regex = BREAKSCAPE_V2_BODY_REGEX;
|
|
292
|
+
replacer = BREAKSCAPE_V2_BODY_REGEX_REPLACER;
|
|
293
|
+
}
|
|
294
|
+
else {
|
|
295
|
+
regex = BREAKSCAPE_MINUSMINUS_BODY_REGEX;
|
|
296
|
+
replacer = BREAKSCAPE_MINUSMINUS_BODY_REGEX_REPLACER;
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
else if (textFormat === TextFormat_1.TextFormat.bitmarkPlusPlus) {
|
|
300
|
+
if (v2) {
|
|
301
|
+
// Hack for v2 breakscaping (still needed??)
|
|
302
|
+
regex = BREAKSCAPE_V2_BODY_REGEX;
|
|
303
|
+
replacer = BREAKSCAPE_V2_BODY_REGEX_REPLACER;
|
|
304
|
+
}
|
|
305
|
+
else {
|
|
306
|
+
regex = BREAKSCAPE_PLUSPLUS_BODY_REGEX;
|
|
307
|
+
replacer = BREAKSCAPE_PLUSPLUS_BODY_REGEX_REPLACER;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
return { regex, replacer };
|
|
312
|
+
}
|
|
313
|
+
/**
|
|
314
|
+
* For unbreakscaping, select the correct regex and replacer for the text format and location.
|
|
315
|
+
*
|
|
316
|
+
* @param textFormat the format of the text
|
|
317
|
+
* @param textLocation the location of the text
|
|
318
|
+
* @returns the regex and replacer
|
|
319
|
+
*/
|
|
320
|
+
selectUnbreakscapeRegexAndReplacer(textFormat, textLocation) {
|
|
321
|
+
const isPlain = !(textFormat === TextFormat_1.TextFormat.bitmarkMinusMinus || textFormat === TextFormat_1.TextFormat.bitmarkPlusPlus);
|
|
322
|
+
let regex = UNBREAKSCAPE_REGEX;
|
|
323
|
+
let replacer = UNBREAKSCAPE_REGEX_REPLACER;
|
|
324
|
+
if (textLocation === TextLocation_1.TextLocation.body && isPlain) {
|
|
325
|
+
regex = UNBREAKSCAPE_PLAIN_IN_BODY_REGEX;
|
|
326
|
+
replacer = UNBREAKSCAPE_PLAIN_IN_BODY_REGEX_REPLACER;
|
|
327
|
+
}
|
|
328
|
+
return { regex, replacer };
|
|
329
|
+
}
|
|
273
330
|
/**
|
|
274
331
|
* Concatenate two breakscaped strings.
|
|
275
332
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Breakscape.js","sourceRoot":"","sources":["../../../src/breakscaping/Breakscape.ts"],"names":[],"mappings":";;;AACA,yDAAsE;AACtE,sDAAmD;AAEnD
|
|
1
|
+
{"version":3,"file":"Breakscape.js","sourceRoot":"","sources":["../../../src/breakscaping/Breakscape.ts"],"names":[],"mappings":";;;AACA,yDAAsE;AACtE,6DAA4E;AAC5E,sDAAmD;AAEnD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2FG;AAEH,EAAE;AACF,eAAe;AACf,EAAE;AAEF,MAAM,WAAW,GAAG,iBAAiB,CAAC,CAAC,wCAAwC;AAC/E,MAAM,YAAY,GAAG,sCAAsC,CAAC,CAAC,gBAAgB;AAC7E,MAAM,kBAAkB,GAAG,yBAAyB,CAAC,CAAC,gBAAgB;AACtE,MAAM,iBAAiB,GAAG,mDAAmD,CAAC,CAAC,kBAAkB;AACjG,MAAM,kBAAkB,GAAG,yBAAyB,CAAC,CAAC,gCAAgC;AACtF,MAAM,oBAAoB,GAAG,kBAAkB,CAAC,CAAC,iCAAiC;AAClF,MAAM,wBAAwB,GAAG,sBAAsB,CAAC,CAAC,iCAAiC;AAC1F,MAAM,gBAAgB,GAAG,QAAQ,CAAC,CAAC,8BAA8B;AACjE,MAAM,eAAe,GAAG,gBAAgB,CAAC,CAAC,sBAAsB;AAChE,MAAM,UAAU,GAAG,OAAO,CAAC,CAAC,0EAA0E;AAEtG,MAAM,mCAAmC,GAAG,GAAG,WAAW,CAAC,MA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AEnD,IAAI,YAAY,KAAK,2BAAY,CAAC,IAAI,IAAI,OAAO,EAAE,CAAC;YAClD,KAAK,GAAG,gCAAgC,CAAC;YACzC,QAAQ,GAAG,yCAAyC,CAAC;QACvD,CAAC;QAED,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;IAC7B,CAAC;IAED;;;;;;OAMG;IACI,WAAW,CAAC,EAAqB,EAAE,EAAqB;QAC7D,OAAO,CAAC,EAAE,GAAG,EAAE,CAAsB,CAAC;IACxC,CAAC;CACF;AAED,MAAM,QAAQ,GAAG,IAAI,UAAU,EAAE,CAAC;AAEb,8BAAU"}
|
|
@@ -1154,6 +1154,7 @@ const BITS = {
|
|
|
1154
1154
|
cardSet: CardSetConfigKey_1.CardSetConfigKey._flashcard,
|
|
1155
1155
|
},
|
|
1156
1156
|
[BitType_1.BitType.flashcard1]: { since: '1.3.0', baseBitType: BitType_1.BitType.flashcard },
|
|
1157
|
+
[BitType_1.BitType.qAndACard]: { since: '3.25.0', baseBitType: BitType_1.BitType.flashcard1 },
|
|
1157
1158
|
[BitType_1.BitType.focusImage]: {
|
|
1158
1159
|
since: '1.3.0',
|
|
1159
1160
|
baseBitType: BitType_1.BitType.image,
|
|
@@ -2229,6 +2230,16 @@ const BITS = {
|
|
|
2229
2230
|
},
|
|
2230
2231
|
],
|
|
2231
2232
|
},
|
|
2233
|
+
[BitType_1.BitType.tocInline]: {
|
|
2234
|
+
since: '3.24.0',
|
|
2235
|
+
baseBitType: BitType_1.BitType.toc,
|
|
2236
|
+
tags: [
|
|
2237
|
+
{
|
|
2238
|
+
type: BitTagType_1.BitTagType.property,
|
|
2239
|
+
configKey: PropertyConfigKey_1.PropertyConfigKey.maxTocChapterLevel,
|
|
2240
|
+
},
|
|
2241
|
+
],
|
|
2242
|
+
},
|
|
2232
2243
|
[BitType_1.BitType.anchor]: { since: '1.3.0', baseBitType: BitType_1.BitType._standard },
|
|
2233
2244
|
[BitType_1.BitType.bitBookEnding]: { since: '1.3.0', baseBitType: BitType_1.BitType._standard },
|
|
2234
2245
|
[BitType_1.BitType.bitBookSummary]: { since: '1.3.0', baseBitType: BitType_1.BitType._standard },
|