Discussion:
Minor formatting glich using Windows version
Rob Mason
2018-06-01 09:31:27 UTC
Permalink
Hi,

This is only a minor issue, but when printing out my dive logs (one dive
layout), the 'Notes' section is not interpreting carriage returns properly
- instead, I see html line breaks <br> which are not being converted.

Affects Subsurface 4.7.8 on Windows 10. Linux Mint 18.3 is fine...


Thanks

RobM
Lubomir I. Ivanov
2018-06-01 17:26:34 UTC
Permalink
Post by Rob Mason
Hi,
This is only a minor issue, but when printing out my dive logs (one dive
layout), the 'Notes' section is not interpreting carriage returns properly -
instead, I see html line breaks <br> which are not being converted.
Affects Subsurface 4.7.8 on Windows 10. Linux Mint 18.3 is fine...
the bundled HTML printing templates should work without the <br> problem.

did you make modifications to the templates? the `dive.notes` variable
needs to be extended with `|safe` to support html tags.

example:
<td class="fieldData">
<p> {{ dive.notes|safe }} </p>
</td>

lubomir
--
Lubomir I. Ivanov
2018-06-01 17:52:43 UTC
Permalink
Post by Lubomir I. Ivanov
Post by Rob Mason
Hi,
This is only a minor issue, but when printing out my dive logs (one dive
layout), the 'Notes' section is not interpreting carriage returns properly -
instead, I see html line breaks <br> which are not being converted.
Affects Subsurface 4.7.8 on Windows 10. Linux Mint 18.3 is fine...
the bundled HTML printing templates should work without the <br> problem.
did you make modifications to the templates? the `dive.notes` variable
needs to be extended with `|safe` to support html tags.
<td class="fieldData">
<p> {{ dive.notes|safe }} </p>
</td>
just submitted a change for our user manual about that:
https://github.com/Subsurface-divelog/subsurface/pull/1347/files

lubomir
--
Lubomir I. Ivanov
2018-06-02 11:50:23 UTC
Permalink
Hi Lubomir - I haven't made any change to the report templates. Those
extensions were already present in the "One Dive.html' template. The Windows
version of subsurface seems to be ignoring the `|safe` option?
i have just tried and `|safe` works for me under Windows.

you could try
- stop subsurface
- delete the templates listed here:
<windows-drive>:\Users\<your-user>\AppData\Roaming\Subsurface\printing_templates>
(unless you have modifications made on them)
- restart subsurface

this would ensure that the templates are recreated from the bundled ones.

lubomir
--
Rob Mason
2018-06-02 11:57:36 UTC
Permalink
Hi Lubomir - that's solved it thanks.
Post by Rob Mason
Hi Lubomir - I haven't made any change to the report templates. Those
extensions were already present in the "One Dive.html' template. The
Windows
version of subsurface seems to be ignoring the `|safe` option?
i have just tried and `|safe` works for me under Windows.
you could try
- stop subsurface
<windows-drive>:\Users\<your-user>\AppData\Roaming\
Subsurface\printing_templates>
(unless you have modifications made on them)
- restart subsurface
this would ensure that the templates are recreated from the bundled ones.
lubomir
--
_______________________________________________
subsurface mailing list
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface
Loading...