@gmb/bitmark-parser-generator 1.35.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 +776 -389
- 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/breakscaping/Breakscape.js +96 -71
- package/dist/cjs/breakscaping/Breakscape.js.map +1 -1
- package/dist/cjs/config/raw/bits.js +14 -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 +1 -0
- 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 +959 -338
- package/dist/cjs/generator/bitmark/BitmarkGenerator.js.map +1 -1
- package/dist/cjs/generator/json/JsonGenerator.js +308 -1982
- 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 +27 -8
- 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 +1 -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 -1
- package/dist/cjs/parser/bitmark/peg/BitmarkPegParserHelper.js +9 -3
- package/dist/cjs/parser/bitmark/peg/BitmarkPegParserHelper.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/BitmarkPegParserProcessor.js +49 -131
- package/dist/cjs/parser/bitmark/peg/BitmarkPegParserProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/BitmarkPegParserTypes.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/BitmarkPegParserValidator.js +7 -31
- 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 -765
- package/dist/cjs/parser/json/JsonParser.js.map +1 -1
- package/dist/cjs/parser/text/TextParser.js +61 -2
- 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/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 +776 -389
- 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/breakscaping/Breakscape.js +96 -71
- package/dist/esm/breakscaping/Breakscape.js.map +1 -1
- package/dist/esm/config/raw/bits.js +14 -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 +1 -0
- 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 +959 -338
- package/dist/esm/generator/bitmark/BitmarkGenerator.js.map +1 -1
- package/dist/esm/generator/json/JsonGenerator.js +308 -1982
- 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 +27 -8
- 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 +1 -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 -1
- package/dist/esm/parser/bitmark/peg/BitmarkPegParserHelper.js +9 -3
- package/dist/esm/parser/bitmark/peg/BitmarkPegParserHelper.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/BitmarkPegParserProcessor.js +49 -131
- package/dist/esm/parser/bitmark/peg/BitmarkPegParserProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/BitmarkPegParserTypes.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/BitmarkPegParserValidator.js +7 -31
- 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 -765
- package/dist/esm/parser/json/JsonParser.js.map +1 -1
- package/dist/esm/parser/text/TextParser.js +61 -2
- 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/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 +279 -441
- 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/breakscaping/Breakscape.d.ts +6 -5
- 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 +89 -55
- package/dist/types/generator/bitmark/BitmarkGenerator.d.ts.map +1 -1
- package/dist/types/generator/json/JsonGenerator.d.ts +88 -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 +48 -16
- package/dist/types/model/ast/NodeType.d.ts.map +1 -1
- package/dist/types/model/ast/Nodes.d.ts +64 -440
- 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 +2 -4
- package/dist/types/model/enum/BitType.d.ts.map +1 -1
- 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/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 +3 -2
- package/dist/types/parser/bitmark/peg/BitmarkPegParserHelper.d.ts.map +1 -1
- package/dist/types/parser/bitmark/peg/BitmarkPegParserProcessor.d.ts +2 -15
- package/dist/types/parser/bitmark/peg/BitmarkPegParserProcessor.d.ts.map +1 -1
- package/dist/types/parser/bitmark/peg/BitmarkPegParserTypes.d.ts +83 -71
- 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/package.json +1 -1
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
import { Breakscape } from '../../../../breakscaping/Breakscape';
|
|
2
|
+
import { BodyBitType } from '../../../../model/enum/BodyBitType';
|
|
3
|
+
import { TextFormat } from '../../../../model/enum/TextFormat';
|
|
4
|
+
import { StringUtils } from '../../../../utils/StringUtils';
|
|
5
|
+
import { TextParser } from '../../../text/TextParser';
|
|
6
|
+
import { BitmarkPegParserValidator } from '../BitmarkPegParserValidator';
|
|
7
|
+
import { ContentProcessorUtils } from './ContentProcessorUtils';
|
|
8
|
+
const textParser = new TextParser();
|
|
9
|
+
class BodyContentProcessor {
|
|
10
|
+
process(context, contentDepth, bitType, textFormat, _tagsConfig, _target, bodyParts, isCardBody) {
|
|
11
|
+
const bodyBits = [];
|
|
12
|
+
let finalBody;
|
|
13
|
+
let finalBodyString;
|
|
14
|
+
//
|
|
15
|
+
const trimmedBodyParts = bodyParts.length > 0 ? this.trimBodyParts(bodyParts) : undefined;
|
|
16
|
+
const validatedBodyParts = isCardBody
|
|
17
|
+
? trimmedBodyParts
|
|
18
|
+
: BitmarkPegParserValidator.checkBody(context, contentDepth, bitType, textFormat, trimmedBodyParts);
|
|
19
|
+
// If the text format is JSON, check the body is valid JSON
|
|
20
|
+
// In this case, the body will already have been 'squashed' so will not contain any parsed inline body tags
|
|
21
|
+
if (textFormat === TextFormat.json && validatedBodyParts) {
|
|
22
|
+
finalBody = validatedBodyParts.reduce((acc, val) => {
|
|
23
|
+
var _a;
|
|
24
|
+
if (val.type === BodyBitType.text && val.data) {
|
|
25
|
+
const bodyTextVal = val;
|
|
26
|
+
return (acc + ((_a = bodyTextVal.data.bodyText) !== null && _a !== void 0 ? _a : ''));
|
|
27
|
+
}
|
|
28
|
+
return acc;
|
|
29
|
+
}, '');
|
|
30
|
+
try {
|
|
31
|
+
finalBody = JSON.parse(finalBody);
|
|
32
|
+
}
|
|
33
|
+
catch (e) {
|
|
34
|
+
finalBody = null;
|
|
35
|
+
context.addError(`Body JSON is invalid.`);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
// Standard body
|
|
40
|
+
let bodyTextStr = '';
|
|
41
|
+
let plainBodyTextStr = '';
|
|
42
|
+
let bodyStr = '';
|
|
43
|
+
let placeholderIndex = 0;
|
|
44
|
+
// Function for creating the placeholder keys
|
|
45
|
+
const createPlaceholderKey = (i) => `[!${i}]`;
|
|
46
|
+
// Loop the text bodyParts creating full body text with the correct placeholders
|
|
47
|
+
//
|
|
48
|
+
// fullBodyTextStr:
|
|
49
|
+
// - is created and passed into the text parser to create the body text AST
|
|
50
|
+
// - has placeholders inserted into 'fullBodyTextStr' in the format [!0] to allow the text parser to identify
|
|
51
|
+
// where the body bits should be inserted.
|
|
52
|
+
//
|
|
53
|
+
if (validatedBodyParts) {
|
|
54
|
+
for (let i = 0; i < validatedBodyParts.length; i++) {
|
|
55
|
+
const bodyPart = validatedBodyParts[i];
|
|
56
|
+
const isText = bodyPart.type === BodyBitType.text;
|
|
57
|
+
if (isText) {
|
|
58
|
+
const asText = bodyPart;
|
|
59
|
+
const bodyTextPart = asText.data.bodyText;
|
|
60
|
+
// Append the text part to the full text body
|
|
61
|
+
if (asText.data.isPlain) {
|
|
62
|
+
plainBodyTextStr = Breakscape.concatenate(plainBodyTextStr, bodyTextPart);
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
bodyTextStr = Breakscape.concatenate(bodyTextStr, bodyTextPart);
|
|
66
|
+
}
|
|
67
|
+
bodyStr = Breakscape.concatenate(bodyStr, bodyTextPart);
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
const placeholderKey = createPlaceholderKey(placeholderIndex);
|
|
71
|
+
// Append the placeholder to the full text body
|
|
72
|
+
bodyTextStr = Breakscape.concatenate(bodyTextStr, placeholderKey);
|
|
73
|
+
// Add the body bit to the body bits
|
|
74
|
+
bodyBits.push(bodyPart);
|
|
75
|
+
placeholderIndex++;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
// Create the body text AST
|
|
80
|
+
const isBitmarkText = textFormat === TextFormat.bitmarkMinusMinus || textFormat === TextFormat.bitmarkPlusPlus;
|
|
81
|
+
const parsedBodyText = isBitmarkText
|
|
82
|
+
? textParser.toAst(bodyTextStr, {
|
|
83
|
+
//
|
|
84
|
+
textFormat,
|
|
85
|
+
})
|
|
86
|
+
: Breakscape.unbreakscape(bodyTextStr, {
|
|
87
|
+
textFormat: TextFormat.text,
|
|
88
|
+
});
|
|
89
|
+
const parserPlainText = Breakscape.unbreakscape(plainBodyTextStr, {
|
|
90
|
+
textFormat: TextFormat.text,
|
|
91
|
+
});
|
|
92
|
+
// Newlines will have been lost from the end of bodyTextStr, and start of plainBodyTextStr
|
|
93
|
+
// Count then and add them back when merging
|
|
94
|
+
const newlines = StringUtils.countOccurrencesAtEnd(bodyTextStr, '\n') +
|
|
95
|
+
StringUtils.countOccurrencesAtStart(plainBodyTextStr, '\n');
|
|
96
|
+
finalBody = ContentProcessorUtils.concatenatePlainTextWithAstTexts(parsedBodyText, newlines, parserPlainText);
|
|
97
|
+
finalBodyString = Breakscape.unbreakscape(bodyStr, {
|
|
98
|
+
textFormat,
|
|
99
|
+
}).trim();
|
|
100
|
+
const finalBodyIsAst = Array.isArray(finalBody);
|
|
101
|
+
const bodyAst = finalBodyIsAst ? finalBody : undefined;
|
|
102
|
+
// Loop the body parts again to create the body bits:
|
|
103
|
+
// - The body bits are inserted into body AST, replacing the placeholders created by the text parser
|
|
104
|
+
if (bodyAst && validatedBodyParts) {
|
|
105
|
+
placeholderIndex = 0;
|
|
106
|
+
for (let i = 0; i < validatedBodyParts.length; i++) {
|
|
107
|
+
const bodyPart = validatedBodyParts[i];
|
|
108
|
+
// Skip text body parts as they are handled above
|
|
109
|
+
const isText = bodyPart.type === BodyBitType.text;
|
|
110
|
+
if (isText)
|
|
111
|
+
continue;
|
|
112
|
+
const bodyBit = bodyPart;
|
|
113
|
+
let bodyBitJson;
|
|
114
|
+
switch (bodyPart.type) {
|
|
115
|
+
case BodyBitType.gap: {
|
|
116
|
+
// const gap = bodyBit as Gap;
|
|
117
|
+
// bodyBitJson = this.createGapJson(gap);
|
|
118
|
+
bodyBitJson = bodyBit;
|
|
119
|
+
break;
|
|
120
|
+
}
|
|
121
|
+
case BodyBitType.mark: {
|
|
122
|
+
// const mark = bodyBit as Mark;
|
|
123
|
+
// bodyBitJson = this.createMarkJson(mark);
|
|
124
|
+
bodyBitJson = bodyBit;
|
|
125
|
+
break;
|
|
126
|
+
}
|
|
127
|
+
case BodyBitType.select: {
|
|
128
|
+
// const select = bodyBit as SelectJson;
|
|
129
|
+
// bodyBitJson = this.createSelectJson(select);
|
|
130
|
+
bodyBitJson = bodyBit;
|
|
131
|
+
break;
|
|
132
|
+
}
|
|
133
|
+
case BodyBitType.highlight: {
|
|
134
|
+
// const highlight = bodyBit as Highlight;
|
|
135
|
+
// bodyBitJson = this.createHighlightJson(highlight);
|
|
136
|
+
bodyBitJson = bodyBit;
|
|
137
|
+
break;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
// Add the gap to the placeholders
|
|
141
|
+
if (bodyBitJson) {
|
|
142
|
+
// Insert the body bit into the body AST
|
|
143
|
+
this.replacePlaceholderWithBodyBit(bodyAst, bodyBitJson, placeholderIndex);
|
|
144
|
+
}
|
|
145
|
+
placeholderIndex++;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
} // Standard body
|
|
149
|
+
// Return the body in the target
|
|
150
|
+
return {
|
|
151
|
+
body: finalBody,
|
|
152
|
+
bodyBits: bodyBits.length > 0 ? bodyBits : undefined,
|
|
153
|
+
bodyString: finalBodyString,
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
buildBodyText(bodyTextPart, isPlain) {
|
|
157
|
+
const bodyText = {
|
|
158
|
+
type: BodyBitType.text,
|
|
159
|
+
data: {
|
|
160
|
+
bodyText: bodyTextPart,
|
|
161
|
+
isPlain,
|
|
162
|
+
},
|
|
163
|
+
};
|
|
164
|
+
return bodyText;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Walk the body AST to find the placeholder and replace it with the body bit.
|
|
168
|
+
*
|
|
169
|
+
* @param bodyAst the body AST
|
|
170
|
+
* @param bodyBitJson the body bit json to insert at the placeholder position
|
|
171
|
+
* @param index the index of the placeholder to replace
|
|
172
|
+
*/
|
|
173
|
+
replacePlaceholderWithBodyBit(bodyAst, bodyBitJson, index) {
|
|
174
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
175
|
+
const walkRecursive = (node, parent, parentKey) => {
|
|
176
|
+
if (Array.isArray(node)) {
|
|
177
|
+
// Walk the array of nodes
|
|
178
|
+
for (let i = 0; i < node.length; i++) {
|
|
179
|
+
const child = node[i];
|
|
180
|
+
const done = walkRecursive(child, node, i);
|
|
181
|
+
if (done)
|
|
182
|
+
return true;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
else {
|
|
186
|
+
if (node.type === 'bit' && node.index === index) {
|
|
187
|
+
// Found the placeholder, replace it with the body bit
|
|
188
|
+
parent[parentKey] = bodyBitJson;
|
|
189
|
+
return true;
|
|
190
|
+
}
|
|
191
|
+
if (node.content) {
|
|
192
|
+
// Walk the child content
|
|
193
|
+
const done = walkRecursive(node.content, node, 'content');
|
|
194
|
+
if (done)
|
|
195
|
+
return true;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
return false;
|
|
199
|
+
};
|
|
200
|
+
walkRecursive(bodyAst, null, null);
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Trim the body parts, removing any whitespace only parts at start and end of body
|
|
204
|
+
*
|
|
205
|
+
* @param parts the body parts to trim
|
|
206
|
+
* @returns the trimmed body parts
|
|
207
|
+
*/
|
|
208
|
+
trimBodyParts(parts) {
|
|
209
|
+
// Trim start
|
|
210
|
+
let foundText = false;
|
|
211
|
+
let trimmedParts = parts.reduce((acc, part) => {
|
|
212
|
+
const text = part;
|
|
213
|
+
if (!foundText && text.type === BodyBitType.text) {
|
|
214
|
+
const t = text.data.bodyText.trimStart();
|
|
215
|
+
if (t) {
|
|
216
|
+
foundText = true;
|
|
217
|
+
text.data.bodyText = t;
|
|
218
|
+
acc.push(text);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
else {
|
|
222
|
+
// Not body text, so add it
|
|
223
|
+
foundText = true;
|
|
224
|
+
acc.push(part);
|
|
225
|
+
}
|
|
226
|
+
return acc;
|
|
227
|
+
}, []);
|
|
228
|
+
// Trim end
|
|
229
|
+
foundText = false;
|
|
230
|
+
trimmedParts = trimmedParts.reduceRight((acc, part) => {
|
|
231
|
+
const text = part;
|
|
232
|
+
if (!foundText && text.type === BodyBitType.text) {
|
|
233
|
+
const t = text.data.bodyText.trimEnd();
|
|
234
|
+
if (t) {
|
|
235
|
+
foundText = true;
|
|
236
|
+
text.data.bodyText = t;
|
|
237
|
+
acc.unshift(text);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
else {
|
|
241
|
+
// Not body text, so add it
|
|
242
|
+
foundText = true;
|
|
243
|
+
acc.unshift(part);
|
|
244
|
+
}
|
|
245
|
+
return acc;
|
|
246
|
+
}, []);
|
|
247
|
+
return trimmedParts;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
const instance = new BodyContentProcessor();
|
|
251
|
+
export { instance as BodyContentProcessor };
|
|
252
|
+
//# sourceMappingURL=BodyContentProcessor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BodyContentProcessor.js","sourceRoot":"","sources":["../../../../../../src/parser/bitmark/peg/contentProcessors/BodyContentProcessor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AAMjE,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACjE,OAAO,EAAE,UAAU,EAAkB,MAAM,mCAAmC,CAAC;AAE/E,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAA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,OAAO,GAAG,CAAC;QACb,CAAC,EAAE,EAAgB,CAAC,CAAC;QAErB,WAAW;QACX,SAAS,GAAG,KAAK,CAAC;QAClB,YAAY,GAAG,YAAY,CAAC,WAAW,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;YACpD,MAAM,IAAI,GAAG,IAAgB,CAAC;YAC9B,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,IAAI,KAAK,WAAW,CAAC,IAAI,EAAE,CAAC;gBACjD,MAAM,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAuB,CAAC;gBAC5D,IAAI,CAAC,EAAE,CAAC;oBACN,SAAS,GAAG,IAAI,CAAC;oBACjB,IAAI,CAAC,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC;oBACvB,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;gBACpB,CAAC;YACH,CAAC;iBAAM,CAAC;gBACN,2BAA2B;gBAC3B,SAAS,GAAG,IAAI,CAAC;gBACjB,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YACpB,CAAC;YACD,OAAO,GAAG,CAAC;QACb,CAAC,EAAE,EAAgB,CAAC,CAAC;QAErB,OAAO,YAAY,CAAC;IACtB,CAAC;CACF;AAED,MAAM,QAAQ,GAAG,IAAI,oBAAoB,EAAE,CAAC;AAC5C,OAAO,EAAE,QAAQ,IAAI,oBAAoB,EAAE,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Breakscape } from '../../../../breakscaping/Breakscape';
|
|
1
2
|
import { StringUtils } from '../../../../utils/StringUtils';
|
|
2
3
|
import { BitContentLevel, } from '../BitmarkPegParserTypes';
|
|
3
4
|
// const builder = new Builder();
|
|
@@ -20,7 +21,7 @@ function buildBook(context, _contentDepth, bitType, textFormat, tagsConfig, cont
|
|
|
20
21
|
context.debugPrint('book TAGS', tags);
|
|
21
22
|
const { reference, referenceEnd } = tags;
|
|
22
23
|
// Extract the book from the content tag
|
|
23
|
-
const book = StringUtils.trimmedString(content.value);
|
|
24
|
+
const book = Breakscape.unbreakscape(StringUtils.trimmedString(content.value));
|
|
24
25
|
return {
|
|
25
26
|
book,
|
|
26
27
|
reference,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BookChainContentProcessor.js","sourceRoot":"","sources":["../../../../../../src/parser/bitmark/peg/contentProcessors/BookChainContentProcessor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BookChainContentProcessor.js","sourceRoot":"","sources":["../../../../../../src/parser/bitmark/peg/contentProcessors/BookChainContentProcessor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AAKjE,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAE5D,OAAO,EAEL,eAAe,GAIhB,MAAM,0BAA0B,CAAC;AAElC,iCAAiC;AAEjC,SAAS,yBAAyB,CAChC,OAAgC,EAChC,YAA8B,EAC9B,OAAoB,EACpB,UAA0B,EAC1B,UAAkC,EAClC,OAAmB,EACnB,MAAiC;IAEjC,IAAI,YAAY,KAAK,eAAe,CAAC,KAAK,EAAE,CAAC;QAC3C,aAAa;IACf,CAAC;SAAM,CAAC;QACN,MAAM,IAAI,GAAG,SAAS,CAAC,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;QACxF,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACxB,MAAM,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;QAClC,MAAM,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;IAC1C,CAAC;AACH,CAAC;AAED,SAAS,SAAS,CAChB,OAAgC,EAChC,aAA+B,EAC/B,OAAoB,EACpB,UAA0B,EAC1B,UAAkC,EAClC,OAAmB;IAMnB,IAAI,OAAO,CAAC,mBAAmB;QAAE,OAAO,CAAC,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