<table id="prevent_conversion_to_tml"><tr><td> *should be bold* plain text</td></tr></table>When you go back to WYSIWYG mode, you see this:
*should be bold* plain text |
<table id="prevent_conversion_to_tml"><tr><td> <p class='WYSIWYG_NBNL'></p> *should be bold* <p></p> plain text</td></tr></table>So, as you can see, both lines of text are not immediately preceded by an opening P tag, which makes the code insert these problematic spans:
<table id="prevent_conversion_to_tml"><tr><td> <p class='WYSIWYG_NBNL'></p> <span style="{encoded:'n'}" class="WYSIWYG_HIDDENWHITESPACE"> </span>*should be bold* <p></p> <span style="{encoded:'n'}" class="WYSIWYG_HIDDENWHITESPACE"> </span>plain text</td></tr></table>(Line breaks inserted for easier reading) Now, after the SPANs have been inserted, text styles are applied. Bold formatting (
*foo*
), however, requires that the asterisk is preceded by whitespace (or a line break). This is now no longer the case. Therefore, the asterisks are not converted into HTML formatting.
I would propose changing the way paragraph tags are generated within tables and DIVs (I'm not even sure whether the current markup is valid; is it permissible to nest P tags? This appears to happen in DIVs to some extent...). In short, just use normal paragraph tags (assuming TinyMCE can deal with that; I don't know because I really only use CKEditor). Maybe the output would look like this:
<table id="prevent_conversion_to_tml"><tr><td> <p class='WYSIWYG_NBNL'> <strong>should be bold</strong> </p><p> plain text</p></td></tr></table>The only real difficulty here is patching the final closing P tag into the last line. The code can't currently recognize the right place reliably because it only notices that the table is over when it spots the closing TABLE tag – the closing TD tag might have been on a previous line which we have already added to the output queue. I'm not implementing a fix for now because I don't know whether the current output (the
<p></p>
combos) is intentional. I'd like some feedback before I try anything. Which isn't to say that someone else can't fix it. Summary | WysiwygPlugin: tml2html: introduces spurious hidden whitespace in HTML table cells that contain blank lines |
ReportedBy | JanKrueger |
Codebase | 1.1.6 dev, 1.1.5, trunk |
SVN Range | |
AppliesTo | Extension |
Component | WysiwygPlugin |
Priority | Normal |
CurrentState | Waiting for Release |
WaitingFor | |
Checkins | |
TargetRelease | minor |
ReleasedIn | 2.2.0 |
CheckinsOnBranches | |
trunkCheckins | |
masterCheckins | |
ItemBranchCheckins | |
Release02x01Checkins | |
Release02x00Checkins | |
Release01x01Checkins |