Improve HTML detection from templates
This commit is contained in:
parent
899238ce7c
commit
e0135da65a
|
|
@ -155,7 +155,7 @@ class _InvoiceEmailViewState extends State<InvoiceEmailView>
|
||||||
final company = widget.viewModel.state.company;
|
final company = widget.viewModel.state.company;
|
||||||
if (company.markdownEmailEnabled &&
|
if (company.markdownEmailEnabled &&
|
||||||
widget.viewModel.state.prefState.isDesktop &&
|
widget.viewModel.state.prefState.isDesktop &&
|
||||||
_rawBodyPreview.startsWith('<p>')) {
|
_rawBodyPreview.trim().startsWith('<')) {
|
||||||
_rawBodyPreview = html2md.convert(_rawBodyPreview);
|
_rawBodyPreview = html2md.convert(_rawBodyPreview);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -147,7 +147,7 @@ class _TemplatesAndRemindersState extends State<TemplatesAndReminders>
|
||||||
|
|
||||||
if (viewModel.state.company.markdownEmailEnabled &&
|
if (viewModel.state.company.markdownEmailEnabled &&
|
||||||
widget.viewModel.state.prefState.isDesktop &&
|
widget.viewModel.state.prefState.isDesktop &&
|
||||||
_bodyController.text.startsWith('<p>')) {
|
_bodyController.text.trim().startsWith('<')) {
|
||||||
_bodyController.text = html2md.convert(_bodyController.text);
|
_bodyController.text = html2md.convert(_bodyController.text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -164,7 +164,7 @@ class _TemplatesAndRemindersState extends State<TemplatesAndReminders>
|
||||||
|
|
||||||
if (state.company.markdownEmailEnabled &&
|
if (state.company.markdownEmailEnabled &&
|
||||||
widget.viewModel.state.prefState.isDesktop &&
|
widget.viewModel.state.prefState.isDesktop &&
|
||||||
_defaultBody.startsWith('<p>')) {
|
_defaultBody.trim().startsWith('<')) {
|
||||||
_defaultBody = html2md.convert(_defaultBody);
|
_defaultBody = html2md.convert(_defaultBody);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue