Skip to content

Commit

Permalink
Item13369: Item13371: Item13372L: encoding fixes. Note that there are…
Browse files Browse the repository at this point in the history
… certain strings involving entities that cannot be expected to ROUNDTRIP, as the entities get converted unconditionally back to codepoints. While this *could* be changed, it would require significant engineering effort.
  • Loading branch information
Comment committed Apr 20, 2015
1 parent 390ac7f commit 7f5796f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Expand Up @@ -1371,9 +1371,13 @@ sub _checkAfterEmphasis {
sub _verbatim {
my ( $this, $tag, $options ) = @_;

$options |= WC::PROTECTED | WC::BR2NL | WC::KEEP_WS;
# KEEP_ENTITIES for literal and pre
$options |= WC::PROTECTED | WC::KEEP_ENTITIES | WC::BR2NL | WC::KEEP_WS;
my ( $flags, $text ) = $this->_flatten($options);

# Don't do this for literal or sticky
WC::decodeRepresentableEntities($text);

my $p = _htmlParams( $this->{attrs}, $options );

return ( $flags, "<$tag$p>$text</$tag>" );
Expand Down
6 changes: 5 additions & 1 deletion WysiwygPlugin/test/unit/WysiwygPlugin/TranslatorTests.pm
Expand Up @@ -2947,12 +2947,16 @@ HTML
TML
},
{
exec => ROUNDTRIP,
exec => TML2HTML,
name => 'entityNamedInsideMacro_Item13369',
tml => <<'TML',
Outside macro &copy; dash &mdash; done
%MAKETEXT{"Copyright &&copy; mdash &&mdash;"}%
TML
html => <<'HTML',
<p> Outside macro &copy; dash &mdash; done <span class='WYSIWYG_PROTECTED'><br />%MAKETEXT{&#34;Copyright&nbsp;&#38;&#38;copy;&nbsp;mdash&nbsp;&#38;&#38;mdash;&#34;}%</span>
</p>
HTML
},
{
exec => TML2HTML | HTML2TML | ROUNDTRIP,
Expand Down

0 comments on commit 7f5796f

Please sign in to comment.