-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Thorsten Marx
committed
Sep 23, 2024
1 parent
e596a75
commit 480aee0
Showing
13 changed files
with
157 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
cms-content/src/test/java/com/condation/cms/content/markdown/IssuesTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
package com.condation.cms.content.markdown; | ||
|
||
/*- | ||
* #%L | ||
* cms-content | ||
* %% | ||
* Copyright (C) 2023 - 2024 CondationCMS | ||
* %% | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as | ||
* published by the Free Software Foundation, either version 3 of the | ||
* License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public | ||
* License along with this program. If not, see | ||
* <http://www.gnu.org/licenses/gpl-3.0.html>. | ||
* #L% | ||
*/ | ||
|
||
import java.io.IOException; | ||
import org.assertj.core.api.Assertions; | ||
import org.junit.jupiter.api.BeforeAll; | ||
import org.junit.jupiter.api.RepeatedTest; | ||
|
||
/** | ||
* | ||
* @author t.marx | ||
*/ | ||
public class IssuesTest extends MarkdownTest { | ||
|
||
static CMSMarkdown SUT; | ||
|
||
@BeforeAll | ||
public static void setup() { | ||
SUT = new CMSMarkdown(Options.all()); | ||
} | ||
|
||
@RepeatedTest(1) | ||
public void issue_with_multiple_code_blocks() throws IOException { | ||
|
||
var md = load("issues/issue.code-with-shortcode.md").trim(); | ||
var expected = load("issues/issue.code-with-shortcode.html"); | ||
expected = removeComments(expected); | ||
|
||
var result = SUT.render(md); | ||
result = "<div>" + result + "</div>"; | ||
Assertions.assertThat(result).isEqualToIgnoringWhitespace(expected); | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...nt/src/test/resources/com/condation/cms/content/markdown/features.shortcodes.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# task list test | ||
|
||
a paragraph with [[link id="google",title="Google" /]] | ||
a paragraph with [[link id="google" title="Google" /]] | ||
|
||
# next | ||
|
||
[[link id="apache",title="Apache" /]] | ||
[[link id="apache" title="Apache" /]] |
22 changes: 22 additions & 0 deletions
22
...c/test/resources/com/condation/cms/content/markdown/issues/issue.code-with-shortcode.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<!-- | ||
#%L | ||
cms-markdown | ||
%% | ||
Copyright (C) 2023 - 2024 Marx-Software | ||
%% | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as | ||
published by the Free Software Foundation, either version 3 of the | ||
License, or (at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public | ||
License along with this program. If not, see | ||
<http://www.gnu.org/licenses/gpl-3.0.html>. | ||
#L% | ||
--> | ||
<div><pre><code class='lang-html'>\[\[video type="youtube" id="y0sF5xhGreA" title="Everybody loves little cats" /\]\]</code></pre></div> |
5 changes: 5 additions & 0 deletions
5
...esources/com/condation/cms/content/markdown/issues/issue.code-with-shortcode.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
```html | ||
\\[\\[video type="youtube" id="y0sF5xhGreA" title="Everybody loves little cats" /\\]\\] | ||
``` | ||
|
||
|