Closed er4z0r closed 3 weeks ago
Thanks for providing the sample, @er4z0r! This is fixed as part of #513.
Added the stacktrace. Just for sake of completeness. Also here is a minimized code sample for testing:
<ul>
<li>
<blockquote class="blockquote"><span class="italic">yadda yadda-yadda yadda</span></blockquote>
</li>
</ul>
Looks like it only happens with blockquote inside ul/li. I tried the other way around and it did not trigger.
Hey, I just tested this on my installation updated to 4.2.5 and it seems the issue still persists.
ERROR 2024-09-11 08:56:50,418 __init__ 16 140347578334008 Template TypeError, may be a bug or an issue with the template
Traceback (most recent call last):
File "/app/ghostwriter/modules/reportwriter/base/__init__.py", line 62, in map_jinja2_render_errors
return callback()
File "/app/ghostwriter/modules/reportwriter/base/docx.py", line 227, in <lambda>
lambda: HtmlToDocxWithEvidence.run(
File "/app/ghostwriter/modules/reportwriter/richtext/ooxml.py", line 111, in run
instance.process_children(tag.children)
File "/app/ghostwriter/modules/reportwriter/richtext/ooxml.py", line 125, in process_children
self.process(ch, **kwargs)
File "/app/ghostwriter/modules/reportwriter/richtext/ooxml.py", line 117, in process
getattr(self, "tag_" + el.name)(el, **kwargs)
File "/app/ghostwriter/modules/reportwriter/richtext/docx.py", line 199, in tag_ul
self.process_children(
File "/app/ghostwriter/modules/reportwriter/richtext/ooxml.py", line 125, in process_children
self.process(ch, **kwargs)
File "/app/ghostwriter/modules/reportwriter/richtext/ooxml.py", line 117, in process
getattr(self, "tag_" + el.name)(el, **kwargs)
File "/app/ghostwriter/modules/reportwriter/richtext/docx.py", line 221, in tag_blockquote
self.process_children(el.children, par=par, **kwargs)
TypeError: ghostwriter.modules.reportwriter.richtext.ooxml.BaseHtmlToOOXML.process_children() got multiple values for keyword argument 'par'
To clarify, v4.3.0-rc1 has a patch that fixes the error, but blockquotes-in-lists and vice versa aren't really supported in Word, so the output isn't amazing. Both "blockquote" and "list paragraph" are "styles" and a Word paragraph can only have one. You can try it yourself by trying to apply a Quote style in Word onto a list - at least for me, it strips the list bullets when doing so.
Specifically commit 3646614b2de97f9flc20, which should have mentioned this issue in its description.
Ah okay that explains it. I had misread the comment by chris. Probably undercaffeinated. I'll check in the pre-release. As long as it does not break report generation I'm good. The resulting word document needs some finishing touches anyway.
Whoops that's not actually true... I don't think I actually pushed the commit I was thinking of.
Describe the bug A colleague of mine has managed (according to them using only copy & paste + editor) to produce an issue description that broke the document export.
To Reproduce Steps to reproduce the behavior:
TypeError: ghostwriter.modules.reportwriter.html_to_ooxml.BaseHtmlToOOXML.process_children() got multiple values for keyword argument 'par'
Here's the full stack-trace:
Looks like the issue arises when a blockquote is used inside an unordered list. Expected Behavior TBH I'm not sure. I have no idea how he managed to create that mess. Maybe give a hint to recheck formatting?
Workaround Use "View > Show Blocks" in Editor or modify HTML directly. Change code so blockquote includes the ul if that is what you need.
Server Specs:
Additional context
I still have to check this one on 4.2.5 but since that currently breaks my export (see #499) it will take time. Could you please try to reproduce it on 4.2.5 in the meantime?Confirmed to also affect 4.2.5