@gmb/bitmark-parser-generator 1.34.0 → 2.0.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 +8 -3
- package/dist/cjs/BitmarkParserGenerator.js.map +1 -1
- package/dist/cjs/ast/Ast.js +1 -0
- package/dist/cjs/ast/Ast.js.map +1 -1
- package/dist/cjs/ast/BaseBuilder.js +91 -54
- package/dist/cjs/ast/BaseBuilder.js.map +1 -1
- package/dist/cjs/ast/Builder.js +780 -377
- package/dist/cjs/ast/Builder.js.map +1 -1
- package/dist/cjs/ast/ResourceBuilder.js +516 -252
- package/dist/cjs/ast/ResourceBuilder.js.map +1 -1
- package/dist/cjs/ast/rules/NodeValidator.js +61 -22
- package/dist/cjs/ast/rules/NodeValidator.js.map +1 -1
- package/dist/cjs/ast/writer/StreamWriter.js +13 -0
- package/dist/cjs/ast/writer/StreamWriter.js.map +1 -1
- package/dist/cjs/ast/writer/StringWriter.js +13 -0
- package/dist/cjs/ast/writer/StringWriter.js.map +1 -1
- package/dist/cjs/breakscaping/Breakscape.js +122 -95
- package/dist/cjs/breakscaping/Breakscape.js.map +1 -1
- package/dist/cjs/config/raw/bits.js +24 -5
- package/dist/cjs/config/raw/bits.js.map +1 -1
- package/dist/cjs/config/raw/properties.js +7 -2
- package/dist/cjs/config/raw/properties.js.map +1 -1
- package/dist/cjs/generated/build-info.js +1 -1
- package/dist/cjs/generated/build-info.js.map +1 -1
- package/dist/cjs/generated/parser/bitmark/bitmark-peggy-parser.js +312 -262
- package/dist/cjs/generated/parser/bitmark/bitmark-peggy-parser.js.map +1 -1
- package/dist/cjs/generator/AstWalkerGenerator.js +4 -1
- package/dist/cjs/generator/AstWalkerGenerator.js.map +1 -1
- package/dist/cjs/generator/bitmark/BitmarkGenerator.js +977 -336
- package/dist/cjs/generator/bitmark/BitmarkGenerator.js.map +1 -1
- package/dist/cjs/generator/json/JsonGenerator.js +361 -1964
- package/dist/cjs/generator/json/JsonGenerator.js.map +1 -1
- package/dist/cjs/generator/text/TextGenerator.js +26 -8
- package/dist/cjs/generator/text/TextGenerator.js.map +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/model/ast/NodeType.js +64 -42
- 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 -2
- package/dist/cjs/model/enum/BitType.js.map +1 -1
- package/dist/cjs/model/enum/PropertyFormat.js +3 -1
- package/dist/cjs/model/enum/PropertyFormat.js.map +1 -1
- package/dist/cjs/model/enum/TextFormat.js +1 -0
- package/dist/cjs/model/enum/TextFormat.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/BitmarkPegParserHelper.js +22 -4
- package/dist/cjs/parser/bitmark/peg/BitmarkPegParserHelper.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/BitmarkPegParserProcessor.js +93 -88
- package/dist/cjs/parser/bitmark/peg/BitmarkPegParserProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/BitmarkPegParserTypes.js +3 -1
- package/dist/cjs/parser/bitmark/peg/BitmarkPegParserTypes.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/BitmarkPegParserValidator.js +10 -32
- package/dist/cjs/parser/bitmark/peg/BitmarkPegParserValidator.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/BodyContentProcessor.js +255 -0
- package/dist/cjs/parser/bitmark/peg/contentProcessors/BodyContentProcessor.js.map +1 -0
- package/dist/cjs/parser/bitmark/peg/contentProcessors/BookChainContentProcessor.js +2 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/BookChainContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/CardContentProcessor.js +175 -129
- package/dist/cjs/parser/bitmark/peg/contentProcessors/CardContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/ClozeTagContentProcessor.js +8 -2
- package/dist/cjs/parser/bitmark/peg/contentProcessors/ClozeTagContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/ContentProcessorUtils.js +61 -0
- package/dist/cjs/parser/bitmark/peg/contentProcessors/ContentProcessorUtils.js.map +1 -0
- package/dist/cjs/parser/bitmark/peg/contentProcessors/DefaultTagContentProcessor.js +11 -5
- package/dist/cjs/parser/bitmark/peg/contentProcessors/DefaultTagContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/ExampleTagContentProcessor.js +21 -17
- package/dist/cjs/parser/bitmark/peg/contentProcessors/ExampleTagContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/FooterContentProcessor.js +50 -0
- package/dist/cjs/parser/bitmark/peg/contentProcessors/FooterContentProcessor.js.map +1 -0
- package/dist/cjs/parser/bitmark/peg/contentProcessors/GapChainContentProcessor.js +2 -15
- package/dist/cjs/parser/bitmark/peg/contentProcessors/GapChainContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/ImageSourceChainContentProcessor.js +2 -4
- package/dist/cjs/parser/bitmark/peg/contentProcessors/ImageSourceChainContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/ItemLeadTagContentProcessor.js +4 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/ItemLeadTagContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/MarkChainContentProcessor.js +2 -4
- package/dist/cjs/parser/bitmark/peg/contentProcessors/MarkChainContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/MarkConfigChainContentProcessor.js +5 -5
- package/dist/cjs/parser/bitmark/peg/contentProcessors/MarkConfigChainContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/PersonChainContentProcessor.js +5 -6
- package/dist/cjs/parser/bitmark/peg/contentProcessors/PersonChainContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/PropertyContentProcessor.js +23 -7
- package/dist/cjs/parser/bitmark/peg/contentProcessors/PropertyContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/RatingLevelChainContentProcessor.js +5 -5
- package/dist/cjs/parser/bitmark/peg/contentProcessors/RatingLevelChainContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/ReferenceTagContentProcessor.js +3 -2
- package/dist/cjs/parser/bitmark/peg/contentProcessors/ReferenceTagContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/ResourceContentProcessor.js +19 -8
- package/dist/cjs/parser/bitmark/peg/contentProcessors/ResourceContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/ServingsChainContentProcessor.js +4 -6
- package/dist/cjs/parser/bitmark/peg/contentProcessors/ServingsChainContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/TechnicalTermChainContentProcessor.js +4 -5
- package/dist/cjs/parser/bitmark/peg/contentProcessors/TechnicalTermChainContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/TitleTagContentProcessor.js +14 -5
- package/dist/cjs/parser/bitmark/peg/contentProcessors/TitleTagContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/TrueFalseChainContentProcessor.js +37 -21
- package/dist/cjs/parser/bitmark/peg/contentProcessors/TrueFalseChainContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/TrueFalseTagContentProcessor.js +3 -2
- package/dist/cjs/parser/bitmark/peg/contentProcessors/TrueFalseTagContentProcessor.js.map +1 -1
- package/dist/cjs/parser/json/JsonParser.js +73 -759
- package/dist/cjs/parser/json/JsonParser.js.map +1 -1
- package/dist/cjs/parser/text/TextParser.js +75 -1
- package/dist/cjs/parser/text/TextParser.js.map +1 -1
- package/dist/cjs/utils/BitUtils.js +15 -13
- package/dist/cjs/utils/BitUtils.js.map +1 -1
- package/dist/cjs/utils/StringUtils.js +40 -0
- package/dist/cjs/utils/StringUtils.js.map +1 -1
- package/dist/esm/BitmarkParserGenerator.js +8 -3
- package/dist/esm/BitmarkParserGenerator.js.map +1 -1
- package/dist/esm/ast/Ast.js +1 -0
- package/dist/esm/ast/Ast.js.map +1 -1
- package/dist/esm/ast/BaseBuilder.js +91 -54
- package/dist/esm/ast/BaseBuilder.js.map +1 -1
- package/dist/esm/ast/Builder.js +780 -377
- package/dist/esm/ast/Builder.js.map +1 -1
- package/dist/esm/ast/ResourceBuilder.js +516 -252
- package/dist/esm/ast/ResourceBuilder.js.map +1 -1
- package/dist/esm/ast/rules/NodeValidator.js +61 -22
- package/dist/esm/ast/rules/NodeValidator.js.map +1 -1
- package/dist/esm/ast/writer/StreamWriter.js +13 -0
- package/dist/esm/ast/writer/StreamWriter.js.map +1 -1
- package/dist/esm/ast/writer/StringWriter.js +13 -0
- package/dist/esm/ast/writer/StringWriter.js.map +1 -1
- package/dist/esm/breakscaping/Breakscape.js +122 -95
- package/dist/esm/breakscaping/Breakscape.js.map +1 -1
- package/dist/esm/config/raw/bits.js +24 -5
- package/dist/esm/config/raw/bits.js.map +1 -1
- package/dist/esm/config/raw/properties.js +7 -2
- package/dist/esm/config/raw/properties.js.map +1 -1
- package/dist/esm/generated/build-info.js +1 -1
- package/dist/esm/generated/build-info.js.map +1 -1
- package/dist/esm/generated/parser/bitmark/bitmark-peggy-parser.js +312 -262
- package/dist/esm/generated/parser/bitmark/bitmark-peggy-parser.js.map +1 -1
- package/dist/esm/generator/AstWalkerGenerator.js +4 -1
- package/dist/esm/generator/AstWalkerGenerator.js.map +1 -1
- package/dist/esm/generator/bitmark/BitmarkGenerator.js +977 -336
- package/dist/esm/generator/bitmark/BitmarkGenerator.js.map +1 -1
- package/dist/esm/generator/json/JsonGenerator.js +361 -1964
- package/dist/esm/generator/json/JsonGenerator.js.map +1 -1
- package/dist/esm/generator/text/TextGenerator.js +26 -8
- package/dist/esm/generator/text/TextGenerator.js.map +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/model/ast/NodeType.js +64 -42
- 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 -2
- package/dist/esm/model/enum/BitType.js.map +1 -1
- package/dist/esm/model/enum/PropertyFormat.js +3 -1
- package/dist/esm/model/enum/PropertyFormat.js.map +1 -1
- package/dist/esm/model/enum/TextFormat.js +1 -0
- package/dist/esm/model/enum/TextFormat.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/BitmarkPegParserHelper.js +22 -4
- package/dist/esm/parser/bitmark/peg/BitmarkPegParserHelper.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/BitmarkPegParserProcessor.js +93 -88
- package/dist/esm/parser/bitmark/peg/BitmarkPegParserProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/BitmarkPegParserTypes.js +3 -1
- package/dist/esm/parser/bitmark/peg/BitmarkPegParserTypes.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/BitmarkPegParserValidator.js +10 -32
- package/dist/esm/parser/bitmark/peg/BitmarkPegParserValidator.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/BodyContentProcessor.js +252 -0
- package/dist/esm/parser/bitmark/peg/contentProcessors/BodyContentProcessor.js.map +1 -0
- package/dist/esm/parser/bitmark/peg/contentProcessors/BookChainContentProcessor.js +2 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/BookChainContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/CardContentProcessor.js +175 -129
- package/dist/esm/parser/bitmark/peg/contentProcessors/CardContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/ClozeTagContentProcessor.js +8 -2
- package/dist/esm/parser/bitmark/peg/contentProcessors/ClozeTagContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/ContentProcessorUtils.js +58 -0
- package/dist/esm/parser/bitmark/peg/contentProcessors/ContentProcessorUtils.js.map +1 -0
- package/dist/esm/parser/bitmark/peg/contentProcessors/DefaultTagContentProcessor.js +11 -5
- package/dist/esm/parser/bitmark/peg/contentProcessors/DefaultTagContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/ExampleTagContentProcessor.js +21 -17
- package/dist/esm/parser/bitmark/peg/contentProcessors/ExampleTagContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/FooterContentProcessor.js +47 -0
- package/dist/esm/parser/bitmark/peg/contentProcessors/FooterContentProcessor.js.map +1 -0
- package/dist/esm/parser/bitmark/peg/contentProcessors/GapChainContentProcessor.js +2 -15
- package/dist/esm/parser/bitmark/peg/contentProcessors/GapChainContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/ImageSourceChainContentProcessor.js +2 -4
- package/dist/esm/parser/bitmark/peg/contentProcessors/ImageSourceChainContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/ItemLeadTagContentProcessor.js +4 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/ItemLeadTagContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/MarkChainContentProcessor.js +2 -4
- package/dist/esm/parser/bitmark/peg/contentProcessors/MarkChainContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/MarkConfigChainContentProcessor.js +5 -5
- package/dist/esm/parser/bitmark/peg/contentProcessors/MarkConfigChainContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/PersonChainContentProcessor.js +5 -6
- package/dist/esm/parser/bitmark/peg/contentProcessors/PersonChainContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/PropertyContentProcessor.js +23 -7
- package/dist/esm/parser/bitmark/peg/contentProcessors/PropertyContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/RatingLevelChainContentProcessor.js +5 -5
- package/dist/esm/parser/bitmark/peg/contentProcessors/RatingLevelChainContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/ReferenceTagContentProcessor.js +3 -2
- package/dist/esm/parser/bitmark/peg/contentProcessors/ReferenceTagContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/ResourceContentProcessor.js +19 -8
- package/dist/esm/parser/bitmark/peg/contentProcessors/ResourceContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/ServingsChainContentProcessor.js +4 -6
- package/dist/esm/parser/bitmark/peg/contentProcessors/ServingsChainContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/TechnicalTermChainContentProcessor.js +4 -5
- package/dist/esm/parser/bitmark/peg/contentProcessors/TechnicalTermChainContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/TitleTagContentProcessor.js +14 -5
- package/dist/esm/parser/bitmark/peg/contentProcessors/TitleTagContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/TrueFalseChainContentProcessor.js +37 -21
- package/dist/esm/parser/bitmark/peg/contentProcessors/TrueFalseChainContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/TrueFalseTagContentProcessor.js +3 -2
- package/dist/esm/parser/bitmark/peg/contentProcessors/TrueFalseTagContentProcessor.js.map +1 -1
- package/dist/esm/parser/json/JsonParser.js +73 -759
- package/dist/esm/parser/json/JsonParser.js.map +1 -1
- package/dist/esm/parser/text/TextParser.js +75 -1
- package/dist/esm/parser/text/TextParser.js.map +1 -1
- package/dist/esm/utils/BitUtils.js +15 -13
- package/dist/esm/utils/BitUtils.js.map +1 -1
- package/dist/esm/utils/StringUtils.js +40 -0
- package/dist/esm/utils/StringUtils.js.map +1 -1
- package/dist/types/BitmarkParserGenerator.d.ts +8 -0
- package/dist/types/BitmarkParserGenerator.d.ts.map +1 -1
- package/dist/types/ast/Ast.d.ts.map +1 -1
- package/dist/types/ast/BaseBuilder.d.ts +31 -21
- package/dist/types/ast/BaseBuilder.d.ts.map +1 -1
- package/dist/types/ast/Builder.d.ts +283 -435
- package/dist/types/ast/Builder.d.ts.map +1 -1
- package/dist/types/ast/ResourceBuilder.d.ts +177 -164
- package/dist/types/ast/ResourceBuilder.d.ts.map +1 -1
- package/dist/types/ast/rules/NodeValidator.d.ts +3 -2
- package/dist/types/ast/rules/NodeValidator.d.ts.map +1 -1
- package/dist/types/ast/writer/StreamWriter.d.ts +2 -0
- package/dist/types/ast/writer/StreamWriter.d.ts.map +1 -1
- package/dist/types/ast/writer/StringWriter.d.ts +2 -0
- package/dist/types/ast/writer/StringWriter.d.ts.map +1 -1
- package/dist/types/ast/writer/Writer.d.ts +6 -0
- package/dist/types/ast/writer/Writer.d.ts.map +1 -1
- package/dist/types/breakscaping/Breakscape.d.ts +6 -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/properties.d.ts.map +1 -1
- package/dist/types/generated/parser/bitmark/bitmark-peggy-parser.d.ts.map +1 -1
- package/dist/types/generator/AstWalkerGenerator.d.ts.map +1 -1
- package/dist/types/generator/bitmark/BitmarkGenerator.d.ts +91 -55
- package/dist/types/generator/bitmark/BitmarkGenerator.d.ts.map +1 -1
- package/dist/types/generator/json/JsonGenerator.d.ts +96 -108
- package/dist/types/generator/json/JsonGenerator.d.ts.map +1 -1
- package/dist/types/generator/text/TextGenerator.d.ts +14 -2
- package/dist/types/generator/text/TextGenerator.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/model/ast/NodeType.d.ts +122 -84
- package/dist/types/model/ast/NodeType.d.ts.map +1 -1
- package/dist/types/model/ast/Nodes.d.ts +66 -436
- package/dist/types/model/ast/Nodes.d.ts.map +1 -1
- package/dist/types/model/ast/TextNodes.d.ts +1 -1
- package/dist/types/model/ast/TextNodes.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 -4
- package/dist/types/model/enum/PropertyFormat.d.ts +4 -2
- package/dist/types/model/enum/PropertyFormat.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 +2 -0
- package/dist/types/model/enum/TextFormat.d.ts.map +1 -1
- package/dist/types/model/json/BitJson.d.ts +32 -20
- package/dist/types/model/json/BitJson.d.ts.map +1 -1
- package/dist/types/model/json/BodyBitJson.d.ts +16 -12
- package/dist/types/model/json/BodyBitJson.d.ts.map +1 -1
- package/dist/types/model/json/ResourceJson.d.ts +2 -22
- package/dist/types/model/json/ResourceJson.d.ts.map +1 -1
- package/dist/types/parser/bitmark/peg/BitmarkPegParserHelper.d.ts +4 -2
- package/dist/types/parser/bitmark/peg/BitmarkPegParserHelper.d.ts.map +1 -1
- package/dist/types/parser/bitmark/peg/BitmarkPegParserProcessor.d.ts +3 -9
- package/dist/types/parser/bitmark/peg/BitmarkPegParserProcessor.d.ts.map +1 -1
- package/dist/types/parser/bitmark/peg/BitmarkPegParserTypes.d.ts +90 -74
- package/dist/types/parser/bitmark/peg/BitmarkPegParserTypes.d.ts.map +1 -1
- package/dist/types/parser/bitmark/peg/BitmarkPegParserValidator.d.ts +2 -2
- package/dist/types/parser/bitmark/peg/BitmarkPegParserValidator.d.ts.map +1 -1
- package/dist/types/parser/bitmark/peg/contentProcessors/BodyContentProcessor.d.ts +37 -0
- package/dist/types/parser/bitmark/peg/contentProcessors/BodyContentProcessor.d.ts.map +1 -0
- package/dist/types/parser/bitmark/peg/contentProcessors/BookChainContentProcessor.d.ts.map +1 -1
- package/dist/types/parser/bitmark/peg/contentProcessors/CardContentProcessor.d.ts +2 -2
- 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/ContentProcessorUtils.d.ts +15 -0
- package/dist/types/parser/bitmark/peg/contentProcessors/ContentProcessorUtils.d.ts.map +1 -0
- 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 +16 -0
- package/dist/types/parser/bitmark/peg/contentProcessors/FooterContentProcessor.d.ts.map +1 -0
- package/dist/types/parser/bitmark/peg/contentProcessors/GapChainContentProcessor.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/ItemLeadTagContentProcessor.d.ts.map +1 -1
- package/dist/types/parser/bitmark/peg/contentProcessors/MarkChainContentProcessor.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/RatingLevelChainContentProcessor.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 +2 -2
- package/dist/types/parser/bitmark/peg/contentProcessors/ResourceContentProcessor.d.ts.map +1 -1
- package/dist/types/parser/bitmark/peg/contentProcessors/ServingsChainContentProcessor.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/TitleTagContentProcessor.d.ts +5 -2
- package/dist/types/parser/bitmark/peg/contentProcessors/TitleTagContentProcessor.d.ts.map +1 -1
- package/dist/types/parser/bitmark/peg/contentProcessors/TrueFalseChainContentProcessor.d.ts +1 -1
- package/dist/types/parser/bitmark/peg/contentProcessors/TrueFalseChainContentProcessor.d.ts.map +1 -1
- package/dist/types/parser/bitmark/peg/contentProcessors/TrueFalseTagContentProcessor.d.ts.map +1 -1
- package/dist/types/parser/json/JsonParser.d.ts +9 -72
- package/dist/types/parser/json/JsonParser.d.ts.map +1 -1
- package/dist/types/parser/text/TextParser.d.ts +16 -1
- package/dist/types/parser/text/TextParser.d.ts.map +1 -1
- package/dist/types/utils/BitUtils.d.ts +8 -8
- package/dist/types/utils/BitUtils.d.ts.map +1 -1
- package/dist/types/utils/StringUtils.d.ts +24 -0
- package/dist/types/utils/StringUtils.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Breakscape = void 0;
|
|
4
|
+
const TextFormat_1 = require("../model/enum/TextFormat");
|
|
4
5
|
const StringUtils_1 = require("../utils/StringUtils");
|
|
5
6
|
/**
|
|
6
7
|
* Utility class for breakscaping strings.
|
|
@@ -12,109 +13,114 @@ const StringUtils_1 = require("../utils/StringUtils");
|
|
|
12
13
|
* being broken (split) by a special charater.
|
|
13
14
|
*
|
|
14
15
|
* The special character is ^
|
|
15
|
-
* To include the special character in a text
|
|
16
|
+
* To include the special character in a text which is breakscaped, use ^^ (once), ^^^ (twice), etc.
|
|
16
17
|
*
|
|
17
|
-
*
|
|
18
|
-
* - inline: == ==> =^=
|
|
19
|
-
* - title block: (SOL)[##]#(space) ==> (SOL)[##]#^(space)
|
|
20
|
-
* - new block: (SOL)|(WS EOL) ==> (SOL)|^(WS EOL)
|
|
21
|
-
* - code block: (SOL)|code(:type) ==> (SOL)|^code(:type)
|
|
22
|
-
* - image block: (SOL)|image:(url) ==> (SOL)|^image:(url)
|
|
23
|
-
* - bullet list: (SOL)•(space) ==> (SOL)•^(space)
|
|
24
|
-
* - ordered list: (SOL)•1(space) ==> (SOL)•^1(space)
|
|
25
|
-
* - tag list +: (SOL)•+(space) ==> (SOL)•^+(space)
|
|
26
|
-
* - tag list -: (SOL)•-(space) ==> (SOL)•^-(space)
|
|
27
|
-
* - bold: ** ==> *^*
|
|
28
|
-
* - light: `` ==> `^`
|
|
29
|
-
* - italic: __ ==> _^_
|
|
30
|
-
* - highlight: !! ==> !^!
|
|
31
|
-
* - start of bit: [. ==> [^.
|
|
32
|
-
* - start of property: [@ ==> [^@
|
|
33
|
-
* - start of title: [# ==> [^#
|
|
34
|
-
* - start of anchor: [▼ ==> [^▼
|
|
35
|
-
* - start of reference: [► ==> [^►
|
|
36
|
-
* - start of item/lead: [% ==> [^%
|
|
37
|
-
* - start of instruction: [! ==> [^!
|
|
38
|
-
* - start of hint: [? ==> [^?
|
|
39
|
-
* - start of true statement: [+ ==> [^+
|
|
40
|
-
* - start of false statement: [- ==> [^-
|
|
41
|
-
* - start of sample solution: [$ ==> [^$
|
|
42
|
-
* - start of gap: [_ ==> [^_
|
|
43
|
-
* - start of mark: [= ==> [^=
|
|
44
|
-
* - start of resource: [& ==> [^&
|
|
45
|
-
* - end of tag: ] ==> ^]
|
|
18
|
+
* Any sequence can be breakscaped by breaking it with a ^ character.
|
|
46
19
|
*
|
|
20
|
+
* The following unbreakscaping rules are applied when unbreakscaping text:
|
|
21
|
+
* - hat: ^ ==>
|
|
22
|
+
* - hat: ^^ ==> ^
|
|
23
|
+
* - hat: ^..N ==> ^..N-1
|
|
47
24
|
*
|
|
48
|
-
* The following
|
|
49
|
-
* -
|
|
50
|
-
* -
|
|
51
|
-
* -
|
|
52
|
-
* -
|
|
53
|
-
* -
|
|
54
|
-
* -
|
|
55
|
-
* -
|
|
56
|
-
* -
|
|
57
|
-
* -
|
|
58
|
-
* -
|
|
59
|
-
* -
|
|
60
|
-
* -
|
|
61
|
-
* -
|
|
62
|
-
* -
|
|
63
|
-
* -
|
|
64
|
-
* -
|
|
65
|
-
* -
|
|
66
|
-
* -
|
|
67
|
-
* -
|
|
68
|
-
* -
|
|
69
|
-
* -
|
|
70
|
-
* -
|
|
71
|
-
* -
|
|
72
|
-
* -
|
|
73
|
-
* -
|
|
74
|
-
* -
|
|
75
|
-
* -
|
|
76
|
-
* -
|
|
77
|
-
* -
|
|
25
|
+
* The following breakscaping rules are applied when breakscaping text:
|
|
26
|
+
* - hat: ^ ==> ^^ [bitmark-- / bitmark++]
|
|
27
|
+
* - hat: ^^ ==> ^^^ [bitmark-- / bitmark++]
|
|
28
|
+
* - hat: ^..N ==> ^..N+1 [bitmark-- / bitmark++]
|
|
29
|
+
* - inline: == ==> =^= [bitmark++]
|
|
30
|
+
* - title block: (SOL)[##]#(space) ==> (SOL)[##]#^(space) [bitmark++]
|
|
31
|
+
* - new block: (SOL)|(WS EOL) ==> (SOL)|^(WS EOL) [bitmark++]
|
|
32
|
+
* - code block: (SOL)|code(:type) ==> (SOL)|^code(:type) [bitmark++]
|
|
33
|
+
* - image block: (SOL)|image:(url) ==> (SOL)|^image:(url) [bitmark++]
|
|
34
|
+
* - bullet list: (SOL)•(space) ==> (SOL)•^(space) [bitmark++]
|
|
35
|
+
* - simple list: (SOL)•_(space) ==> (SOL)•^_(space) [bitmark++]
|
|
36
|
+
* - ordered list (numeric): (SOL)•<numbers>(space) ==> (SOL)•^<numbers>(space) [bitmark++]
|
|
37
|
+
* - ordered list: (roman,lower) (SOL)•<numbers>i(space) ==> (SOL)•^<numbers>i(space) [bitmark++]
|
|
38
|
+
* - ordered list: (roman,upper) (SOL)•<numbers>I(space) ==> (SOL)•^<numbers>I(space) [bitmark++]
|
|
39
|
+
* - ordered list: (SOL)•<letters>(space) ==> (SOL)•^<letters>(space) [bitmark++]
|
|
40
|
+
* - tag list +: (SOL)•+(space) ==> (SOL)•^+(space) [bitmark++]
|
|
41
|
+
* - tag list -: (SOL)•-(space) ==> (SOL)•^-(space) [bitmark++]
|
|
42
|
+
* - bold: ** ==> *^* [bitmark-- / bitmark++]
|
|
43
|
+
* - half-bold (at end): *<end> ==> *^<end> [bitmark-- / bitmark++]
|
|
44
|
+
* - half-bold (at start): <start>* ==> <start>^* [bitmark-- / bitmark++]
|
|
45
|
+
* - light: `` ==> `^` [bitmark-- / bitmark++]
|
|
46
|
+
* - half-light (at end): `<end> ==> `^<end> [bitmark-- / bitmark++]
|
|
47
|
+
* - half-light (at start): <start>` ==> <start>^` [bitmark-- / bitmark++]
|
|
48
|
+
* - italic: __ ==> _^_ [bitmark-- / bitmark++]
|
|
49
|
+
* - half-italic (at end): _<end> ==> _^<end> [bitmark-- / bitmark++]
|
|
50
|
+
* - half-italic (at start): <start>_ ==> <start>^_ [bitmark-- / bitmark++]
|
|
51
|
+
* - highlight: !! ==> !^! [bitmark-- / bitmark++]
|
|
52
|
+
* - half-highlight (at end): !<end> ==> !^<end> [bitmark-- / bitmark++]
|
|
53
|
+
* - half-highlight (at start): <start>! ==> <start>^! [bitmark-- / bitmark++]
|
|
54
|
+
* - start of bit (at end): [<end> ==> [^<end> [bitmark-- / bitmark++]
|
|
55
|
+
* - start of bit: [. ==> [^. [bitmark-- / bitmark++]
|
|
56
|
+
* - start of property: [@ ==> [^@ [bitmark-- / bitmark++]
|
|
57
|
+
* - start of title: [# ==> [^# [bitmark-- / bitmark++]
|
|
58
|
+
* - start of anchor: [▼ ==> [^▼ [bitmark-- / bitmark++]
|
|
59
|
+
* - start of reference: [► ==> [^► [bitmark-- / bitmark++]
|
|
60
|
+
* - start of item/lead: [% ==> [^% [bitmark-- / bitmark++]
|
|
61
|
+
* - start of instruction: [! ==> [^! [bitmark-- / bitmark++]
|
|
62
|
+
* - start of hint: [? ==> [^? [bitmark-- / bitmark++]
|
|
63
|
+
* - start of true statement: [+ ==> [^+ [bitmark-- / bitmark++]
|
|
64
|
+
* - start of false statement: [- ==> [^- [bitmark-- / bitmark++]
|
|
65
|
+
* - start of sample solution: [$ ==> [^$ [bitmark-- / bitmark++]
|
|
66
|
+
* - start of gap: [_ ==> [^_ [bitmark-- / bitmark++]
|
|
67
|
+
* - start of mark: [= ==> [^= [bitmark-- / bitmark++]
|
|
68
|
+
* - start of resource: [& ==> [^& [bitmark-- / bitmark++]
|
|
69
|
+
* - end of tag: ] ==> ^] [bitmark-- / bitmark++]
|
|
70
|
+
*
|
|
71
|
+
* In non- bitmark++ / bitmark-- text, breakscaping is only applied to bit tags.
|
|
72
|
+
* This is true for both breakscaping and unbreakscaping.
|
|
73
|
+
*
|
|
74
|
+
* The following unbreakscaping rules are applied when unbreakscaping plain text:
|
|
75
|
+
* - start of bit: <line start>[^. ==> <line start>[.
|
|
76
|
+
* - start of bit: <line start>[^^. ==> <line start>[^.
|
|
77
|
+
* - start of bit: <line start>[^..N. ==> <line start>[^..N-1.
|
|
78
|
+
*
|
|
79
|
+
* The following breakscaping rules are applied when breakscaping plain text:
|
|
80
|
+
* - start of bit: <line start>[. ==> <line start>[^.
|
|
81
|
+
* - start of bit: <line start>[^. ==> <line start>[^^.
|
|
82
|
+
* - start of bit: <line start>[^..N. ==> <line start>[^..N+1.
|
|
78
83
|
*/
|
|
79
84
|
//
|
|
80
85
|
// Breakscaping
|
|
81
86
|
//
|
|
82
|
-
const REGEX_MARKS = /([*`_
|
|
83
|
-
const REGEX_BLOCKS = /^(\|)(
|
|
84
|
-
const REGEX_TITLE_BLOCKS = /^([#]{1,3})([
|
|
85
|
-
const REGEX_LIST_BLOCKS = /^(•)([
|
|
86
|
-
const REGEX_START_OF_TAG = /(\[)([
|
|
87
|
-
const
|
|
88
|
-
const
|
|
89
|
-
const
|
|
90
|
-
//
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
//
|
|
105
|
-
//
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
const
|
|
109
|
-
const
|
|
110
|
-
const UNBREAKSCAPE_REGEX = new RegExp(UNBREAKSCAPE_REGEX_SOURCE, 'gm');
|
|
111
|
-
const UNBREAKSCAPE_REGEX_REPLACER = BREAKSCAPE_REGEX_REPLACER.replace(/\^/g, ''); // Remove ^ from the regex replacer
|
|
87
|
+
const REGEX_MARKS = /([*`_!=])(?=\1)/; // $1^
|
|
88
|
+
const REGEX_BLOCKS = /^(\|)(code[\s]*|code:|image:|[\s]*$)/; // $2^$3
|
|
89
|
+
const REGEX_TITLE_BLOCKS = /^([#]{1,3})([^\S\r\n]+)/; // $4^$5
|
|
90
|
+
const REGEX_LIST_BLOCKS = /^(•)([0-9]+[iI]*|[a-zA-Z]{1}|_|\+|-|)([^\S\r\n]+)/; // $6^$7$8
|
|
91
|
+
const REGEX_START_OF_TAG = /(\[)([.@#▼►%!?+\-$_=&])/; // $9^$10 / $2^$3
|
|
92
|
+
const REGEX_FOOTER_DIVIDER = /^(~)(~~~)[ \t]*$/; // $11^$12 / $4^$5
|
|
93
|
+
const REGEX_PLAIN_TEXT_DIVIDER = /^(\$)(\$\$\$)[ \t]*$/; // $13^$14 / $6^$7
|
|
94
|
+
const REGEX_END_OF_TAG = /(\^*])/; // ^$15 / ^$8
|
|
95
|
+
const REGEX_HATS = /(\^+)/; // $16^ / ^$9 // Must be last
|
|
96
|
+
const BREAKSCAPE_PLUSPLUS_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_END_OF_TAG.source}|${REGEX_HATS.source}`;
|
|
97
|
+
const BREAKSCAPE_MINUSMINUS_REGEX_SOURCE = `${REGEX_MARKS.source}|${REGEX_START_OF_TAG.source}|${REGEX_FOOTER_DIVIDER.source}|${REGEX_PLAIN_TEXT_DIVIDER.source}|${REGEX_END_OF_TAG.source}|${REGEX_HATS.source}`;
|
|
98
|
+
const REGEX_START = /^([*`_!=])/; // ^$1
|
|
99
|
+
const REGEX_END = /([*`_!=\\[])$/; // $2^
|
|
100
|
+
const BREAKSCAPE_ENDS_REGEX_SOURCE = `${REGEX_START.source}|${REGEX_END.source}`;
|
|
101
|
+
const BREAKSCAPE_PLUSPLUS_REGEX = new RegExp(BREAKSCAPE_PLUSPLUS_REGEX_SOURCE, 'gm');
|
|
102
|
+
const BREAKSCAPE_PLUSPLUS_REGEX_REPLACER = '$1$2$4$6$9$11$13$16^$3$5$7$8$10$12$14$15';
|
|
103
|
+
const BREAKSCAPE_MINUSMINUS_REGEX = new RegExp(BREAKSCAPE_MINUSMINUS_REGEX_SOURCE, 'gm');
|
|
104
|
+
const BREAKSCAPE_MINUSMINUS_REGEX_REPLACER = '$1$2$4$6^$3$5$7$8$9';
|
|
105
|
+
const BREAKSCAPE_PLAIN_IN_BODY_REGEX = new RegExp('^(\\[)(\\^*)(\\.)', 'gm');
|
|
106
|
+
const BREAKSCAPE_PLAIN_IN_BODY_REGEX_REPLACER = '$1^$2$3';
|
|
107
|
+
const BREAKSCAPE_ENDS_REGEX = new RegExp(BREAKSCAPE_ENDS_REGEX_SOURCE, 'g');
|
|
108
|
+
const BREAKSCAPE_ENDS_REGEX_REPLACER = '$2^$1';
|
|
109
|
+
// const UNBREAKSCAPE_REGEX = new RegExp(UNBREAKSCAPE_REGEX_SOURCE, 'gm');
|
|
110
|
+
// const UNBREAKSCAPE_REGEX_REPLACER = BREAKSCAPE_REGEX_REPLACER.replace(/\^/g, ''); // Remove ^ from the regex replacer
|
|
111
|
+
const UNBREAKSCAPE_REGEX = new RegExp('\\^([\\^]*)', 'gm');
|
|
112
|
+
const UNBREAKSCAPE_REGEX_REPLACER = '$1';
|
|
113
|
+
const UNBREAKSCAPE_PLAIN_IN_BODY_REGEX = new RegExp('^(\\[)\\^(\\^*)(\\.)', 'gm');
|
|
114
|
+
const UNBREAKSCAPE_PLAIN_IN_BODY_REGEX_REPLACER = '$1$2$3';
|
|
112
115
|
// Regex explanation:
|
|
113
116
|
// - match a single | or • or # character at the start of a line and capture in group 1
|
|
114
117
|
// This will capture all new block characters within the code text.
|
|
115
118
|
// Replace with group 1, ^
|
|
116
119
|
const BREAKSCAPE_CODE_REGEX = new RegExp('^(\\||•|#)', 'gm');
|
|
117
120
|
const BREAKSCAPE_CODE_REGEX_REPLACER = '$1^';
|
|
121
|
+
const DEFAULT_BREAKSCAPE_OPTIONS = {
|
|
122
|
+
textFormat: TextFormat_1.TextFormat.bitmarkMinusMinus,
|
|
123
|
+
};
|
|
118
124
|
class Breakscape {
|
|
119
125
|
constructor() {
|
|
120
126
|
this.EMPTY_STRING = '';
|
|
@@ -131,11 +137,26 @@ class Breakscape {
|
|
|
131
137
|
breakscape(val, options) {
|
|
132
138
|
if (val == null)
|
|
133
139
|
return val;
|
|
134
|
-
const opts = Object.assign({}, options);
|
|
140
|
+
const opts = Object.assign({}, DEFAULT_BREAKSCAPE_OPTIONS, options);
|
|
135
141
|
const breakscapeStr = (str) => {
|
|
136
142
|
if (!str)
|
|
137
143
|
return str;
|
|
138
|
-
|
|
144
|
+
let regex = BREAKSCAPE_PLAIN_IN_BODY_REGEX;
|
|
145
|
+
let replacer = BREAKSCAPE_PLAIN_IN_BODY_REGEX_REPLACER;
|
|
146
|
+
if (opts.textFormat === TextFormat_1.TextFormat.bitmarkMinusMinus) {
|
|
147
|
+
regex = BREAKSCAPE_MINUSMINUS_REGEX;
|
|
148
|
+
replacer = BREAKSCAPE_MINUSMINUS_REGEX_REPLACER;
|
|
149
|
+
}
|
|
150
|
+
else if (opts.textFormat === TextFormat_1.TextFormat.bitmarkPlusPlus) {
|
|
151
|
+
regex = BREAKSCAPE_PLUSPLUS_REGEX;
|
|
152
|
+
replacer = BREAKSCAPE_PLUSPLUS_REGEX_REPLACER;
|
|
153
|
+
}
|
|
154
|
+
str = str.replace(regex, replacer);
|
|
155
|
+
// Ends - ensures that the start and end of the string are breakscaped in cases where the ends could otherwise
|
|
156
|
+
// come together to form a recognized sequence
|
|
157
|
+
if (opts.textFormat === TextFormat_1.TextFormat.bitmarkMinusMinus || opts.textFormat === TextFormat_1.TextFormat.bitmarkPlusPlus) {
|
|
158
|
+
str = str.replace(BREAKSCAPE_ENDS_REGEX, BREAKSCAPE_ENDS_REGEX_REPLACER);
|
|
159
|
+
}
|
|
139
160
|
return str;
|
|
140
161
|
};
|
|
141
162
|
if (Array.isArray(val)) {
|
|
@@ -164,11 +185,17 @@ class Breakscape {
|
|
|
164
185
|
unbreakscape(val, options) {
|
|
165
186
|
if (val == null)
|
|
166
187
|
return val;
|
|
167
|
-
const opts = Object.assign({}, options);
|
|
188
|
+
const opts = Object.assign({}, DEFAULT_BREAKSCAPE_OPTIONS, options);
|
|
168
189
|
const unbreakscapeStr = (str) => {
|
|
169
190
|
if (!str)
|
|
170
191
|
return str;
|
|
171
|
-
|
|
192
|
+
let regex = UNBREAKSCAPE_PLAIN_IN_BODY_REGEX;
|
|
193
|
+
let replacer = UNBREAKSCAPE_PLAIN_IN_BODY_REGEX_REPLACER;
|
|
194
|
+
if (opts.textFormat === TextFormat_1.TextFormat.bitmarkMinusMinus || opts.textFormat === TextFormat_1.TextFormat.bitmarkPlusPlus) {
|
|
195
|
+
regex = UNBREAKSCAPE_REGEX;
|
|
196
|
+
replacer = UNBREAKSCAPE_REGEX_REPLACER;
|
|
197
|
+
}
|
|
198
|
+
str = str.replace(regex, replacer);
|
|
172
199
|
return str;
|
|
173
200
|
};
|
|
174
201
|
if (Array.isArray(val)) {
|
|
@@ -200,7 +227,7 @@ class Breakscape {
|
|
|
200
227
|
breakscapeCode(val, options) {
|
|
201
228
|
if (val == null)
|
|
202
229
|
return val;
|
|
203
|
-
const opts = Object.assign({}, options);
|
|
230
|
+
const opts = Object.assign({}, DEFAULT_BREAKSCAPE_OPTIONS, options);
|
|
204
231
|
const breakscapeStr = (str) => {
|
|
205
232
|
if (!str)
|
|
206
233
|
return str;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Breakscape.js","sourceRoot":"","sources":["../../../src/breakscaping/Breakscape.ts"],"names":[],"mappings":";;;AACA,sDAAmD;AAEnD
|
|
1
|
+
{"version":3,"file":"Breakscape.js","sourceRoot":"","sources":["../../../src/breakscaping/Breakscape.ts"],"names":[],"mappings":";;;AACA,yDAAsE;AACtE,sDAAmD;AAEnD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6EG;AAEH,EAAE;AACF,eAAe;AACf,EAAE;AAEF,MAAM,WAAW,GAAG,iBAAiB,CAAC,CAAC,MAAM;AAC7C,MAAM,YAAY,GAAG,sCAAsC,CAAC,CAAC,QAAQ;AACrE,MAAM,kBAAkB,GAAG,yBAAyB,CAAC,CAAC,QAAQ;AAC9D,MAAM,iBAAiB,GAAG,mDAAmD,CAAC,CAAC,UAAU;AACzF,MAAM,kBAAkB,GAAG,yBAAyB,CAAC,CAAC,qBAAqB;AAC3E,MAAM,oBAAoB,GAAG,kBAAkB,CAAC,CAAC,sBAAsB;AACvE,MAAM,wBAAwB,GAAG,sBAAsB,CAAC,CAAC,s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C7B,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"}
|
|
@@ -83,6 +83,7 @@ const BITS = {
|
|
|
83
83
|
},
|
|
84
84
|
],
|
|
85
85
|
},
|
|
86
|
+
[BitType_1.BitType.articleResponsiveAlt]: { since: '2.0.0', baseBitType: BitType_1.BitType.articleResponsive },
|
|
86
87
|
[BitType_1.BitType.standardArticleNormative]: { since: '1.16.0', baseBitType: BitType_1.BitType.article },
|
|
87
88
|
[BitType_1.BitType.standardArticleNonNormative]: { since: '1.16.0', baseBitType: BitType_1.BitType.article },
|
|
88
89
|
[BitType_1.BitType.smartStandardArticleNormative]: { since: '1.28.0', baseBitType: BitType_1.BitType.standardArticleNormative },
|
|
@@ -456,6 +457,15 @@ const BITS = {
|
|
|
456
457
|
type: BitTagType_1.BitTagType.property,
|
|
457
458
|
configKey: PropertyConfigKey_1.PropertyConfigKey.quizStrikethroughSolutions,
|
|
458
459
|
},
|
|
460
|
+
{
|
|
461
|
+
type: BitTagType_1.BitTagType.property,
|
|
462
|
+
configKey: PropertyConfigKey_1.PropertyConfigKey.quizStrikethroughSolutions,
|
|
463
|
+
},
|
|
464
|
+
{
|
|
465
|
+
type: BitTagType_1.BitTagType.property,
|
|
466
|
+
configKey: PropertyConfigKey_1.PropertyConfigKey.additionalSolutions,
|
|
467
|
+
maxCount: Count_1.Count.infinity,
|
|
468
|
+
},
|
|
459
469
|
{
|
|
460
470
|
type: BitTagType_1.BitTagType.group,
|
|
461
471
|
configKey: GroupConfigKey_1.GroupConfigKey.group_gap,
|
|
@@ -500,6 +510,16 @@ const BITS = {
|
|
|
500
510
|
],
|
|
501
511
|
textFormatDefault: TextFormat_1.TextFormat.text,
|
|
502
512
|
},
|
|
513
|
+
[BitType_1.BitType.formula]: {
|
|
514
|
+
since: '1.35.0',
|
|
515
|
+
tags: [
|
|
516
|
+
{
|
|
517
|
+
type: BitTagType_1.BitTagType.group,
|
|
518
|
+
configKey: GroupConfigKey_1.GroupConfigKey.group_standardTags,
|
|
519
|
+
},
|
|
520
|
+
],
|
|
521
|
+
textFormatDefault: TextFormat_1.TextFormat.latex,
|
|
522
|
+
},
|
|
503
523
|
[BitType_1.BitType.appCodeCell]: { since: '1.4.3', baseBitType: BitType_1.BitType.code },
|
|
504
524
|
[BitType_1.BitType.appCodeEditor]: { since: '1.4.3', baseBitType: BitType_1.BitType.code },
|
|
505
525
|
[BitType_1.BitType.appCodeIde]: { since: '1.4.3', baseBitType: BitType_1.BitType.code },
|
|
@@ -756,7 +776,6 @@ const BITS = {
|
|
|
756
776
|
[BitType_1.BitType.danger]: { since: '1.3.0', baseBitType: BitType_1.BitType.article },
|
|
757
777
|
[BitType_1.BitType.dangerAlt]: { since: '1.16.0', baseBitType: BitType_1.BitType.article },
|
|
758
778
|
[BitType_1.BitType.definitionTerm]: { since: '1.34.0', baseBitType: BitType_1.BitType.article },
|
|
759
|
-
[BitType_1.BitType.descriptionTerm]: { since: '1.33.0', baseBitType: BitType_1.BitType.article },
|
|
760
779
|
[BitType_1.BitType.details1]: { since: '1.3.0', baseBitType: BitType_1.BitType.article },
|
|
761
780
|
[BitType_1.BitType.details]: { since: '1.3.0', baseBitType: BitType_1.BitType.article },
|
|
762
781
|
[BitType_1.BitType.editorial]: { since: '1.3.0', baseBitType: BitType_1.BitType.article },
|
|
@@ -1054,10 +1073,6 @@ const BITS = {
|
|
|
1054
1073
|
],
|
|
1055
1074
|
cardSet: CardSetConfigKey_1.CardSetConfigKey._flashcardLike,
|
|
1056
1075
|
},
|
|
1057
|
-
[BitType_1.BitType.descriptionList]: {
|
|
1058
|
-
since: '1.33.0',
|
|
1059
|
-
baseBitType: BitType_1.BitType.definitionList,
|
|
1060
|
-
},
|
|
1061
1076
|
[BitType_1.BitType.flashcard]: {
|
|
1062
1077
|
since: '1.3.0',
|
|
1063
1078
|
tags: [
|
|
@@ -2139,6 +2154,10 @@ const BITS = {
|
|
|
2139
2154
|
type: BitTagType_1.BitTagType.property,
|
|
2140
2155
|
configKey: PropertyConfigKey_1.PropertyConfigKey.tableResizableColumns,
|
|
2141
2156
|
},
|
|
2157
|
+
{
|
|
2158
|
+
type: BitTagType_1.BitTagType.property,
|
|
2159
|
+
configKey: PropertyConfigKey_1.PropertyConfigKey.tableColumnMinWidth,
|
|
2160
|
+
},
|
|
2142
2161
|
],
|
|
2143
2162
|
cardSet: CardSetConfigKey_1.CardSetConfigKey._table,
|
|
2144
2163
|
},
|