diff --git a/README.md b/README.md index 3d53d3f..26b3042 100644 --- a/README.md +++ b/README.md @@ -108,7 +108,26 @@ The HTML output is unsanitized by default. This is intentional as this software Contributions are welcome! Please feel free to submit a Pull Request. +## Development + +When developing, you can run the tests with: + +```bash +cargo test +``` + +The example binary can be helpful here for generating output to test against. + +``` bash +cargo run --bin md_converter -- \ + -f markdown \ + -i ../../tests/fixtures/input_divs_code_and_inline_code.md \ + -o ../../tests/fixtures/expected_output_divs_code_and_inline_code.md +``` + + ## License GPL + diff --git a/src/processor.rs b/src/processor.rs index 17cc38c..583008a 100644 --- a/src/processor.rs +++ b/src/processor.rs @@ -180,11 +180,11 @@ impl<'a> Processor<'a> { } let html = match class { "alert" => "
".to_string(), - "info" => "
".to_string(), + "info" => "
".to_string(), "success" => "
".to_string(), - "warning" => "
".to_string(), - "error" => "
".to_string(), - "tip" => "
".to_string(), + "warning" => "
".to_string(), + "error" => "
".to_string(), + "tip" => "
".to_string(), "fold" => "
📂".to_string(), "summary" => "".to_string(), "col" => "
".to_string(), diff --git a/tests/fixtures/expected_output_divs_code_and_inline_code.md b/tests/fixtures/expected_output_divs_code_and_inline_code.md index 606be19..e1101a5 100644 --- a/tests/fixtures/expected_output_divs_code_and_inline_code.md +++ b/tests/fixtures/expected_output_divs_code_and_inline_code.md @@ -20,11 +20,11 @@ A trailing block: Some other text -
+
More content -
+
This is nested diff --git a/tests/fixtures/expected_output_divs_code_and_inline_code_html.html b/tests/fixtures/expected_output_divs_code_and_inline_code_html.html index 22a4a01..27bb6f5 100644 --- a/tests/fixtures/expected_output_divs_code_and_inline_code_html.html +++ b/tests/fixtures/expected_output_divs_code_and_inline_code_html.html @@ -9,9 +9,9 @@

Details Boxes

A trailing block:

:::

Some other text

-
+

More content

-
+

This is nested

@@ -37,4 +37,3 @@

Display

Inline Code

The sum of the first 10 numbers is 45 all together that is:

- diff --git a/tests/fixtures/expected_output_divs_code_and_inline_code_html.md b/tests/fixtures/expected_output_divs_code_and_inline_code_html.md deleted file mode 100644 index bd34512..0000000 --- a/tests/fixtures/expected_output_divs_code_and_inline_code_html.md +++ /dev/null @@ -1,40 +0,0 @@ -

Heading

-

Details Boxes

-

This is some text

-

this latent will be preserved: -:::

- -

A trailing block:

-

:::

-

Some other text

-
-

More content

-
-

This is nested

-
-
-

A latent block -:::

-

Code Blocks

-

Hidden

-

Display

-
-
let t = "";
-for i in 1..s {
-    t += i;
-    if i != (s-1) {
-        t += " + ";
-    }
-}
-t
-
-
-
1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 32 + 33 + 34 + 35 + 36 + 37 + 38 + 39 + 40 + 41 + 42 + 43 + 44
-
-
-
-

Inline Code

-

The sum of the first 10 numbers is 45 all together that is: 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 32 + 33 + 34 + 35 + 36 + 37 + 38 + 39 + 40 + 41 + 42 + 43 + 44

-