This is an automated email from the ASF dual-hosted git repository. michaelo pushed a commit to branch DOXIA-678 in repository https://gitbox.apache.org/repos/asf/maven-doxia.git
commit 06ab5fbcf8d331ffef16d8c7642f353094f40abb Author: Michael Osipov <micha...@apache.org> AuthorDate: Sun Oct 30 19:19:44 2022 +0100 [DOXIA-678] Add missing elements in Xhtml5BaseParser --- .../maven/doxia/parser/Xhtml5BaseParser.java | 8 ++ .../doxia/module/markdown/MarkdownParserTest.java | 30 +++++ .../test/resources/missing-elements-DOXIA-678.md | 128 +++++++++++++++++++++ 3 files changed, 166 insertions(+) diff --git a/doxia-core/src/main/java/org/apache/maven/doxia/parser/Xhtml5BaseParser.java b/doxia-core/src/main/java/org/apache/maven/doxia/parser/Xhtml5BaseParser.java index 9f3a4aaf..e1619be7 100644 --- a/doxia-core/src/main/java/org/apache/maven/doxia/parser/Xhtml5BaseParser.java +++ b/doxia-core/src/main/java/org/apache/maven/doxia/parser/Xhtml5BaseParser.java @@ -428,6 +428,10 @@ public class Xhtml5BaseParser { handleImgStart( parser, sink, attribs ); } + else if ( parser.getName().equals( HtmlMarkup.BLOCKQUOTE.toString() ) ) + { + sink.blockquote( attribs ); + } else if ( parser.getName().equals( HtmlMarkup.SCRIPT.toString() ) || parser.getName().equals( HtmlMarkup.STYLE.toString() ) ) { @@ -703,6 +707,10 @@ public class Xhtml5BaseParser { sink.footer_(); } + else if ( parser.getName().equals( HtmlMarkup.BLOCKQUOTE.toString() ) ) + { + sink.blockquote_(); + } else if ( parser.getName().equals( HtmlMarkup.SCRIPT.toString() ) || parser.getName().equals( HtmlMarkup.STYLE.toString() ) ) { diff --git a/doxia-modules/doxia-module-markdown/src/test/java/org/apache/maven/doxia/module/markdown/MarkdownParserTest.java b/doxia-modules/doxia-module-markdown/src/test/java/org/apache/maven/doxia/module/markdown/MarkdownParserTest.java index 7887f0bd..0002120c 100644 --- a/doxia-modules/doxia-module-markdown/src/test/java/org/apache/maven/doxia/module/markdown/MarkdownParserTest.java +++ b/doxia-modules/doxia-module-markdown/src/test/java/org/apache/maven/doxia/module/markdown/MarkdownParserTest.java @@ -511,4 +511,34 @@ public class MarkdownParserTest } + @Test + public void testDoxia678() + throws Exception + { + Iterator<SinkEventElement> it = parseFileToEventTestingSink( "missing-elements-DOXIA-678" ).getEventList().iterator(); + + /*assertSinkEquals( it, "head", "title", "text", "title_", "head_", + "body", + "list", // TOC start + "listItem", "link", "text", "link_", // first section 2 TOC entry + "list", // sections 3 list start + "listItem", "link", "text", "link_", "listItem_", // empty section 3 TOC entry + "list_", // sections 3 list end + "listItem_", // first section 2 TOC entry end + "listItem", "link", "text", "link_", "listItem_", // second section 2 TOC entry + "list_", // TOC end + "text", + "section1", + "section2", "sectionTitle2", "text", "sectionTitle2_", + "section3", + "section4", "sectionTitle4", "text", "sectionTitle4_", + "section4_", + "section3_", + "section2_", + "section2", "sectionTitle2", "text", "sectionTitle2_", + "section2_", + "section1_", + "body_" );*/ + } + } diff --git a/doxia-modules/doxia-module-markdown/src/test/resources/missing-elements-DOXIA-678.md b/doxia-modules/doxia-module-markdown/src/test/resources/missing-elements-DOXIA-678.md new file mode 100644 index 00000000..62324741 --- /dev/null +++ b/doxia-modules/doxia-module-markdown/src/test/resources/missing-elements-DOXIA-678.md @@ -0,0 +1,128 @@ + + +# Age + + + +| Identifier | `hw_age` | +|---|---| +| Group | <a href="helloworld.html">Hello World</a> | +| Status | 🔵 Active, ✔ Base definition | +| Type | 📋 Input | +| Data Type | 📏 Continuous | + +---- +## Definition + + +The base definition in the reference language (English). This variable in other languages (by country): + + <a title="Bangladesh" class="btn btn-outline-dark" href="BD/hw_age.html"> <span class="flag-icon flag-icon-bd flag-icon-squared"></span> BD</a> <a title="Burkina Faso" class="btn btn-outline-dark" href="BF/hw_age.html"> <span class="flag-icon flag-icon-bf flag-icon-squared"></span> BF</a> <a title="Bolivia" class="btn btn-outline-dark" href="BO/hw_age.html"> <span class="flag-icon flag-icon-bo flag-icon-squared"></span> BO</a> <a title="Brazil" class="btn btn-outline-dark [...] + + +### Prompt + +For input variables, this is the question being asked. For other variable types, this is a short sentence explaining +or contextualizing the values of this variable. + +> What is your age? + + + + + + + + +### Scale + + Values for this variable can be any number (including decimal numbers) between the endpoints (minimum and maximum) of this scale: + + + +| Value | Label | Image | +|---|---|---| +| `0` | Infant | | +| `21` | Young Adult | | + + + +### Normalization +This scale is normalized to the unit range (`0` to `1`, inclusive) by linearly interpolating between the minimum and maximum valid values (`0` and `21`). +To change this behavior, specify a custom scaling expression. + + +---- +## Ontology + +This visualizes the relationship between this variable and its inputs and parent outcomes. + +<div id="#ontology-graph"> + +```mermaid +flowchart RL + classDef deprecated fill:#eee,stroke:#aaa,fill-opacity:0.5 + + hw_person["💬 Hello to person"]:::active + click hw_person "hw_person.html" _blank + hw_age["📋 Age"]:::active + click hw_age "hw_age.html" _blank + + + hw_age --> hw_person + +``` + +</div> + +* Use your mouse wheel or two fingers to zoom in or out +* Click/touch and drag to pan the viewport +* A solid arrow from one variable `A` to another `B` means that `A`'s value is used to calculate `B`'s value +* A dashed arrow from one variable `A` to another `B` means that `A`'s value is used in a condition of `B` (like whether +or not a variant applies), thus indirectly affecting its value + +---- +## Reporting + +Metadata for reporting on this variable's data, usually from analysis of observed data. +This is information on _how_ to report on this variable (metadata only) not reporting of response data itself. + +### Prompt + +A description of the variable for reports. For inputs, this usually is a rephrasing of the main prompt (in the second person) to the third person. + +> What is your age? + + + + + +## Source Code + +Source code for this variable: + +```language-yaml +id: hw_age +type: Input +dataType: Continuous +description: + en-US: Age +definition: + required: true + enabled: true + prompt: + en-US: What is your age? + scale: + values: + - label: + en-US: Infant + key: min + value: 0 + - label: + en-US: Young Adult + key: max + value: 21 +``` + +_Some of this variable's definition may have been inherited from its [group's base definition](helloworld.html)_. +