I exported a session to a HTML document. The <span> tag that creates the monospace font is closed after the first line of output. The remainder of the session is shown in the default font of the browser. Reproducible: Always Steps to Reproduce: 1. Issue multiple commands 2. Export as HTML 3. View the source of the exported HTML Actual Results: Only the first lines were in monospace font. The remainder was in default font. Expected Results: I would expect the whole document to be in monospace font. I would even expect the exported HTML to be valid.
I looked into the source code of Konsole and located the code responsible for it. If I am not mistaken, it is in “src/TerminalCharacterDecoder.cpp” where a function “closeSpan(text)” is called. I am not sure why it does not work yet, and I have yet to set up the build to actually compile it. But I would like to look at it during the next 10 days or so, and try to submit a patch.
Created attachment 82140 [details] Patch to fix this I think I got it right now. After trying to export a session with multiple lines, the output was correct. I would be happy if one of the main developers could look over this and merge it.
Created attachment 82141 [details] Patch Sorry, I did not look at the tabs/spaces. My patch has spaces now.
THanks for looking at this - if you want you can put this up on the KDE patch review site - https://git.reviewboard.kde.org with group Konsole. If not that's OK, I'll look at it either way.
I put it on the review board: https://git.reviewboard.kde.org/r/112507/
Git commit 9f73fbb57f0f2b2ec5c7301b9fc632cde6bd187d by Kurt Hindenburg. Committed on 05/09/2013 at 01:15. Pushed by hindenburg into branch 'master'. Correct <span></span> in HTML output Fix issue where HTML export has too many closing span tags in it. Thanks to Martin Ueding von.kde.org@martin-ueding.de for patch. REVIEW: 112507 FIXED-IN: 4.12 M +6 -2 src/TerminalCharacterDecoder.cpp http://commits.kde.org/konsole/9f73fbb57f0f2b2ec5c7301b9fc632cde6bd187d
Git commit 6b4c8925e1cc7bc599deb82d7b11016c582d4761 by Kurt Hindenburg. Committed on 05/09/2013 at 01:15. Pushed by hindenburg into branch 'KDE/4.11'. Correct <span></span> in HTML output Fix issue where HTML export has too many closing span tags in it. Thanks to Martin Ueding von.kde.org@martin-ueding.de for patch. REVIEW: 112507 FIXED-IN: 4.12 (cherry picked from commit 9f73fbb57f0f2b2ec5c7301b9fc632cde6bd187d) M +6 -2 src/TerminalCharacterDecoder.cpp http://commits.kde.org/konsole/6b4c8925e1cc7bc599deb82d7b11016c582d4761
Git commit b94acfce5051cda379b39b5a03bec507cf8822cf by Kurt Hindenburg. Committed on 05/09/2013 at 01:15. Pushed by hindenburg into branch 'frameworks'. Correct <span></span> in HTML output Fix issue where HTML export has too many closing span tags in it. Thanks to Martin Ueding von.kde.org@martin-ueding.de for patch. REVIEW: 112507 FIXED-IN: 4.12 (cherry picked from commit 9f73fbb57f0f2b2ec5c7301b9fc632cde6bd187d) M +6 -2 src/TerminalCharacterDecoder.cpp http://commits.kde.org/konsole/b94acfce5051cda379b39b5a03bec507cf8822cf