-
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
4 changed files
with
61 additions
and
17 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
processor-commonmark/src/test/kotlin/org/bsc/makdown/commonmark/Issue295Test.kt
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,36 @@ | ||
package org.bsc.makdown.commonmark | ||
|
||
import org.bsc.confluence.model.Site | ||
import org.bsc.markdown.MarkdownVisitorHelper.* | ||
import org.junit.jupiter.api.Assertions.* | ||
import org.junit.jupiter.api.Test | ||
import java.nio.file.Paths | ||
|
||
class Issue295Test { | ||
|
||
var site = Site().apply { | ||
basedir = Paths.get(System.getProperty("user.dir")) | ||
} | ||
|
||
@Test | ||
fun `escape text between curly braces`() { | ||
|
||
assertEquals( "\\{0,128}", escapeMarkdownText( "{0,128}", EscapeTextEnum.LeftCurlyBrace )) | ||
assertEquals( "\\{0,128\\}", escapeMarkdownText( "{0,128}", | ||
EscapeTextEnum.LeftCurlyBrace, EscapeTextEnum.RightCurlyBrace )) | ||
assertEquals( "\\[0,128]", escapeMarkdownText( "[0,128]", EscapeTextEnum.LeftSquareBrace )) | ||
assertEquals( "\\[0,128\\]", escapeMarkdownText( "[0,128]", | ||
EscapeTextEnum.LeftSquareBrace, EscapeTextEnum.RightSquareBrace )) | ||
} | ||
|
||
@Test | ||
fun parse() { | ||
val content = parseResource( this.javaClass, "issue295", this.site ) | ||
|
||
assertEquals(""" | ||
||Property||Default||Required||Description||Example|| | ||
|someEntry|{{\{0,128}}}|false|value that is being misinterpreted as a macro|-| | ||
""".trimIndent(), content ) | ||
} | ||
|
||
} |
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,3 @@ | ||
| Property | Default | Required | Description | Example | | ||
|-----------|------------|----------|-----------------------------------------------|---------| | ||
| someEntry | `\{0,128}` | false | value that is being misinterpreted as a macro | - | |
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