mirror of
https://github.com/kovetskiy/mark.git
synced 2025-04-24 05:42:40 +08:00
Merge pull request #248 from prokod/bugfix/prokod/#247
To add fallback to blockquote when type is none
This commit is contained in:
commit
b82e18f8b8
@ -207,6 +207,15 @@ use `-` as the first character, if you want to have the other goodies
|
|||||||
|
|
||||||
[Code Block Macro]: https://confluence.atlassian.com/doc/code-block-macro-139390.html
|
[Code Block Macro]: https://confluence.atlassian.com/doc/code-block-macro-139390.html
|
||||||
|
|
||||||
|
### Block Quotes
|
||||||
|
|
||||||
|
Block Quotes are converted to Confluence Info/Warn/Note box when the following conditions are met
|
||||||
|
|
||||||
|
1. The BlockQuote is on the root level of the document (not nested)
|
||||||
|
1. The first line of the BlockQuote contains one of the following patterns `Info/Warn/Note`
|
||||||
|
|
||||||
|
In any other case the default behaviour will be resumed and html `<blockquote>` tag will be used
|
||||||
|
|
||||||
## Template & Macros
|
## Template & Macros
|
||||||
|
|
||||||
By default, mark provides several built-in templates and macros:
|
By default, mark provides several built-in templates and macros:
|
||||||
|
@ -247,7 +247,7 @@ func (renderer ConfluenceRenderer) RenderNode(
|
|||||||
|
|
||||||
re := regexp.MustCompile(`[\n\t]`)
|
re := regexp.MustCompile(`[\n\t]`)
|
||||||
|
|
||||||
if quoteLevel == 0 && entering {
|
if quoteLevel == 0 && entering && quoteType != None {
|
||||||
if _, err := writer.Write([]byte(re.ReplaceAllString(fmt.Sprintf(`
|
if _, err := writer.Write([]byte(re.ReplaceAllString(fmt.Sprintf(`
|
||||||
<ac:structured-macro ac:name="%s">
|
<ac:structured-macro ac:name="%s">
|
||||||
<ac:parameter ac:name="icon">true</ac:parameter>
|
<ac:parameter ac:name="icon">true</ac:parameter>
|
||||||
@ -257,7 +257,7 @@ func (renderer ConfluenceRenderer) RenderNode(
|
|||||||
}
|
}
|
||||||
return bf.GoToNext
|
return bf.GoToNext
|
||||||
}
|
}
|
||||||
if quoteLevel == 0 && !entering {
|
if quoteLevel == 0 && !entering && quoteType != None {
|
||||||
if _, err := writer.Write([]byte(re.ReplaceAllString(`
|
if _, err := writer.Write([]byte(re.ReplaceAllString(`
|
||||||
</ac:rich-text-body>
|
</ac:rich-text-body>
|
||||||
</ac:structured-macro>
|
</ac:structured-macro>
|
||||||
|
7
pkg/mark/testdata/quotes.html
vendored
7
pkg/mark/testdata/quotes.html
vendored
@ -24,4 +24,9 @@ b</p>
|
|||||||
<li>Warn bullet 1</li>
|
<li>Warn bullet 1</li>
|
||||||
<li>Warn bullet 2</li>
|
<li>Warn bullet 2</li>
|
||||||
</ul>
|
</ul>
|
||||||
</ac:rich-text-body></ac:structured-macro>
|
</ac:rich-text-body></ac:structured-macro>
|
||||||
|
<h2 id="simple-blockquote">Simple Blockquote</h2>
|
||||||
|
|
||||||
|
<blockquote>
|
||||||
|
<p>This paragraph is a simple blockquote</p>
|
||||||
|
</blockquote>
|
||||||
|
4
pkg/mark/testdata/quotes.md
vendored
4
pkg/mark/testdata/quotes.md
vendored
@ -18,3 +18,7 @@
|
|||||||
>
|
>
|
||||||
> * Warn bullet 1
|
> * Warn bullet 1
|
||||||
> * Warn bullet 2
|
> * Warn bullet 2
|
||||||
|
|
||||||
|
## Simple Blockquote
|
||||||
|
|
||||||
|
> This paragraph is a simple blockquote
|
||||||
|
Loading…
x
Reference in New Issue
Block a user