After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 690860 - Rework serialization format to be XHTML
Rework serialization format to be XHTML
Status: RESOLVED FIXED
Product: bijiben
Classification: Applications
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: Bijiben maintainer(s)
Bijiben maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2012-12-29 17:02 UTC by Giovanni Campagna
Modified: 2013-01-02 23:41 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Rework serialization format to be XHTML (18.19 KB, patch)
2012-12-29 17:02 UTC, Giovanni Campagna
needs-work Details | Review
Rework serialization format to be XHTML (19.92 KB, patch)
2013-01-02 22:58 UTC, Giovanni Campagna
committed Details | Review

Description Giovanni Campagna 2012-12-29 17:02:19 UTC
The real issue is that everytime you add a new line in a note, libxml
fails to parse <br> and nothing gets saved.
Comment 1 Giovanni Campagna 2012-12-29 17:02:22 UTC
Created attachment 232371 [details] [review]
Rework serialization format to be XHTML

Trying to parse HTML using XML tools is hacky and prone to fail in
spectacular ways. And when it fails, we risk losing data, which is very
bad.
Instead, we can make WebKit give us XM and store it directly, using XHTML.
The downside of this is that we need to give WebKit the full document
(including <html xmlns="..."><body>...). The upside is that, as we no
longer parse the note content, anything that can be represented in XHTML
(including images, forms, scripts, plugins...) can now be stored in a
note.
Comment 2 Pierre-Yves Luyten 2012-12-30 01:28:36 UTC
Review of attachment 232371 [details] [review]:

* Tomboy format : wrap_note_content should not be static, so in deserializer.c / process_tomboy_xml_content use it too (otherwise import fails).
* Minor regression for notes icon : when bijiben is closed and reopened, the deserializer do not respect end of lines regarding "raw text" data. But losing data is so cruel that I shall rather fix this afterward.
* The slight syntax fix on shell provider might be included in another patch rather this one.
Comment 3 Giovanni Campagna 2012-12-30 12:59:03 UTC
Yes, I noticed both bugs in later testing; I will prepare a better patch.
Comment 4 Giovanni Campagna 2013-01-02 22:58:15 UTC
Created attachment 232587 [details] [review]
Rework serialization format to be XHTML

Trying to parse HTML using XML tools is hacky and prone to fail in
spectacular ways. And when it fails, we risk losing data, which is very
bad.
Instead, we can make WebKit give us XM and store it directly, using XHTML.
The downside of this is that we need to give WebKit the full document
(including <html xmlns="..."><body>...). The upside is that, as we no
longer parse the note content, anything that can be represented in XHTML
(including images, forms, scripts, plugins...) can now be stored in a
note.

Now newlines should work again...
Comment 5 Pierre-Yves Luyten 2013-01-02 23:19:47 UTC
Review of attachment 232587 [details] [review]:

Cool, this one fixed everything
Comment 6 Giovanni Campagna 2013-01-02 23:41:08 UTC
Attachment 232587 [details] pushed as 817a185 - Rework serialization format to be XHTML