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