The answer can be found on the TBS forum:
http://www.tinybutstrong.com/forum.php?thr=2950
Since you have a conversion function for HTML to ODT, then you can implement it in OpenTBS using a custom PHP function and parameter "onformat".
The following function only convert line breaks:
function f_html2odt($FieldName, &$CurrVal) {
$CurrVal= str_replace('<br />', '<text:line-break/>', $CurrVal);
}
Use in the DOCX template :
[b.thetext;onformat=f_html2odt]
About converting HTML to ODT :
Converting a formated text into another formated text is quite often a nightmare. That's why is it wise to store the pure data instead if formated data.
Converting HTML to ODT is quite difficult because the formating is not structured the same way.
For example, bold or italic can be done in HTML using <b>
and <i>
, while you need styles in ODT.
In HTML you can have text without <p>
, hile in ODT, all text must be at least inside a <text:p>
.