You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When we use cloneBlock in the template and assign values, the content of the document is formatted by default with different styles than when we save the block in the template.
For example, if in my template I have the following formatted in bold, font 12, colors or underlined and more with:
${block}
${title}
${content}
${/block}
When we execute $this->template->cloneBlock('block', 0, true, false, $replacements);
the font style and font size change by default (Calibri, and font size 10).
The strange thing is that the styles are maintained for the line breaks under ${title} or ${content}
Template definition (Museo Sans, Bold, Justify, Font Size 11):
Output (Removes bold; Change font size to 10):
and when the file is processed and you manually write below the elements (it retains some styles from the template):
Describe the bug and add attachments
When we use cloneBlock in the template and assign values, the content of the document is formatted by default with different styles than when we save the block in the template.
For example, if in my template I have the following formatted in bold, font 12, colors or underlined and more with:
${block}
${title}
${content}
${/block}
When we execute
$this->template->cloneBlock('block', 0, true, false, $replacements);
the font style and font size change by default (Calibri, and font size 10).
The strange thing is that the styles are maintained for the line breaks under ${title} or ${content}
Template definition (Museo Sans, Bold, Justify, Font Size 11):
Output (Removes bold; Change font size to 10):
and when the file is processed and you manually write below the elements (it retains some styles from the template):
PD: I am using the HTMLtoOpenXML\Parser to assign html data into the block variables (https://github.com/ffmad/HTMLtoOpenXML) with something like:
Expected behavior
Output content within block variables formatted as the template was configured
Steps to reproduce
Initialize template processor
Process html content with HTMLtoOpenXML
Clone block and assign variables with :
$this->template->cloneBlock('block', 0, true, false, $replacements);
PHPWord version(s) where the bug happened
1.2
PHP version(s) where the bug happened
7.4
The text was updated successfully, but these errors were encountered: