Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ paragraph1\\
paragraph2

[[Caption\\>>image:img.png]]

(% border="1" %)
|var|(%%)(% style="color: #0000ff;" %)asdf\\
|bar|function
.#-----------------------------------------------------
.expect|event/1.0
.#-----------------------------------------------------
Expand Down Expand Up @@ -105,5 +109,26 @@ onNewLine
endParagraph
endFigureCaption
endFigure [[class]=[image]]
beginTable [[border]=[1]]
beginTableRow
beginTableCell
onWord [var]
endTableCell
beginTableCell
beginFormat [NONE] [[style]=[color: #0000ff;]]
onWord [asdf]
onNewLine
endFormat [NONE] [[style]=[color: #0000ff;]]
endTableCell
endTableRow
beginTableRow
beginTableCell
onWord [bar]
endTableCell
beginTableCell
onWord [function]
endTableCell
endTableRow
endTable [[border]=[1]]
endSection
endDocument
Original file line number Diff line number Diff line change
Expand Up @@ -355,12 +355,21 @@ public void onNewLine()
if (getBlockState().isInLine()) {
if (getXWikiSyntaxListenerChain().getConsecutiveNewLineStateChainingListener().getNewLineCount() > 1) {
print("\\\\");
} else if (getXWikiSyntaxListenerChain().getLookaheadChainingListener().getNextEvent().eventType
.isInlineEnd())
{
print("\\\\");
} else {
print("\n");
LookaheadChainingListener lookaheadListener =
getXWikiSyntaxListenerChain().getLookaheadChainingListener();
QueueListener.Event nextEvent = lookaheadListener.getNextEvent();
if (nextEvent.eventType.isInlineEnd()
// Format end events don't print anything for the none format at the end of inline elements as
// the format is automatically reset. So consider that we're already at the end of an inline
// element in that case.
|| (nextEvent.eventType == EventType.END_FORMAT && nextEvent.eventParameters[0] == Format.NONE
&& lookaheadListener.getNextEvent(2).eventType.isInlineEnd()))
{
print("\\\\");
} else {
print("\n");
}
}
} else {
print("\n");
Expand Down