This issue has been created
There are 6 updates.
 
 
LaTeX / cid:jira-generated-image-avatar-b4e04f14-c815-410e-9364-ba8cfc16245f LATEX-153 Closed

Cannot use raw macro under some conditions in the content of a document to be exported to LaTeX

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-000a25f3-06d4-4700-9977-0b62d53f2dfb Vincent Massol created this issue on 09/Sep/24 11:58
 
Summary: Cannot use raw macro under some conditions in the content of a document to be exported to LaTeX
Issue Type: cid:jira-generated-image-avatar-b4e04f14-c815-410e-9364-ba8cfc16245f Bug
Affects Versions: 1.25.1
Assignee: Unassigned
Components: Filter, Syntax
Created: 09/Sep/24 11:58
Priority: cid:jira-generated-image-static-major-14e10723-8490-488d-8d5d-1010b2b091ec Major
Reporter: Vincent Massol
Description:

To reproduce:

{{groovy}}
import org.xwiki.rendering.converter.Converter
import org.xwiki.rendering.renderer.printer.DefaultWikiPrinter;
import org.xwiki.rendering.syntax.Syntax;
import org.xwiki.rendering.syntax.SyntaxType;
import java.io.StringReader;

Syntax LATEX_SYNTAX = new Syntax(new SyntaxType("latex+fragment", "LaTeX-Fragment"), "1.0");

String wikiText = "image:Test.LaTeXFragment@testimage.jpg"
String latexText = ""
if (true) {
Converter converter = services.component.getContextComponentManager().getInstance(Converter.class)
    DefaultWikiPrinter printer = new DefaultWikiPrinter()
    converter.convert(new StringReader(wikiText), Syntax.XWIKI_2_1, LATEX_SYNTAX, printer);
    latexText = printer.toString()
    printer = null
    converter = null
}
return """
{{raw syntax="latex/1.0"}}
$latexText
{{/raw}}
"""
{{/groovy}}

Leads to an exception:

  Cannot invoke "org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream.closeArchiveEntry()" because "zipStream" is null
class java.lang.NullPointerException: Cannot invoke "org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream.closeArchiveEntry()" because "zipStream" is null at wiki:xwiki//org.xwiki.contrib.latex.internal.output.ZipUtils.store(ZipUtils.java:61) at wiki:xwiki//org.xwiki.contrib.latex.internal.output.DefaultLaTeXResourceConverter.store(DefaultLaTeXResourceConverter.java:163) at wiki:xwiki//org.xwiki.contrib.latex.internal.output.DefaultLaTeXResourceConverter.convertATTACHMENTReference(DefaultLaTeXResourceConverter.java:224) at wiki:xwiki//org.xwiki.contrib.latex.internal.output.DefaultLaTeXResourceConverter.convert(DefaultLaTeXResourceConverter.java:142) at wiki:xwiki//org.xwiki.contrib.latex.internal.output.DefaultLaTeXResourceConverter.convert(DefaultLaTeXResourceConverter.java:130) at 
 
 

6 updates

 
cid:jira-generated-image-avatar-000a25f3-06d4-4700-9977-0b62d53f2dfb Changes by Vincent Massol on 09/Sep/24 11:58
 
Fix Version: 1.25.2
Documentation in Release Notes: N/A
Documentation: N/A
Assignee: Vincent Massol
Resolution: Fixed
Status: Open Closed