The format isn't just wrapped around "hi" but around the whole macro
The macro with format after it is standalone and the format is instead wrapped around the next ("Padding") paragraph
In the line with two macros, both macros are wrapped in the format instead of just the second one (same problem as with "hi", just to demonstrate with a macro instead of a word)
The empty format at the end is ignored, the macro is standalone instead
For the first and third problem, I have found that the following patch works:
Index: xwiki-rendering-wikimodel/src/main/java/org/xwiki/rendering/wikimodel/impl/InternalWikiScannerContext.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/xwiki-rendering-wikimodel/src/main/java/org/xwiki/rendering/wikimodel/impl/InternalWikiScannerContext.java b/xwiki-rendering-wikimodel/src/main/java/org/xwiki/rendering/wikimodel/impl/InternalWikiScannerContext.java
--- a/xwiki-rendering-wikimodel/src/main/java/org/xwiki/rendering/wikimodel/impl/InternalWikiScannerContext.java (revision aa207af9364de2ffa51c0e667ac423b79873ed26)
+++ b/xwiki-rendering-wikimodel/src/main/java/org/xwiki/rendering/wikimodel/impl/InternalWikiScannerContext.java (date 1757671310318)
@@ -599,9 +599,12 @@
fMacroName = macroName;
fVerbatimContent = verbatimContent;
}
- openFormat();
+ // First check if we encountered a verbatim or macro that we can now process as inline.
+ // Then open whatever format we encountered. If the format was before the verbatim or macro, we would have
+ // immediately recognized both as inline and processed them already.
checkVerbatim(true);
checkMacro(true);
+ openFormat();
}
private void checkTableCell()
However, this patch doesn't fix the other problems, for those I'm currently not sure where we should produce or discard the format events.
As we're touching the parser here, all of those changes are also very dangerous.
# The format isn't just wrapped around "hi" but also wraps around the whole macro. This is closest to what's described in this issue. # The macro with format after it is standalone and the format is instead wrapped around the next ("Padding") paragraph # In the line with two macros, both macros are wrapped in the format instead of just the second one (same problem as with "hi", just to demonstrate with a macro instead of a word) # The empty format at the end is ignored, the macro is standalone instead
For the first and third problem, I have found that the following patch works:
{code:java} Index: xwiki-rendering-wikimodel/src/main/java/org/xwiki/rendering/wikimodel/impl/InternalWikiScannerContext.java IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/xwiki-rendering-wikimodel/src/main/java/org/xwiki/rendering/wikimodel/impl/InternalWikiScannerContext.java b/xwiki-rendering-wikimodel/src/main/java/org/xwiki/rendering/wikimodel/impl/InternalWikiScannerContext.java --- a/xwiki-rendering-wikimodel/src/main/java/org/xwiki/rendering/wikimodel/impl/InternalWikiScannerContext.java (revision aa207af9364de2ffa51c0e667ac423b79873ed26) +++ b/xwiki-rendering-wikimodel/src/main/java/org/xwiki/rendering/wikimodel/impl/InternalWikiScannerContext.java (date 1757671310318) @@ -599,9 +599,12 @@ fMacroName = macroName; fVerbatimContent = verbatimContent; } - openFormat(); + // First check if we encountered a verbatim or macro that we can now process as inline. + // Then open whatever format we encountered. If the format was before the verbatim or macro, we would have + // immediately recognized both as inline and processed them already. checkVerbatim(true); checkMacro(true); + openFormat(); }
private void checkTableCell() {code}
However, this patch doesn't fix the other problems, for those I'm currently not sure where we should produce or discard the format events.
As we're touching the parser here, all of those changes are also very dangerous.
This message was sent by Atlassian Jira (v9.3.0#930000-sha1:287aeb6)
If image attachments aren't displayed, see this article.