You are here: Foswiki>Tasks Web>Item13225 (05 Jul 2015, GeorgeClark)Edit Attach

Item13225: Wysiwyg defaults to double quotes when generating HTML tags.

pencil
Priority: Normal
Current State: Closed
Released In: 2.0.0
Target Release: major
Applies To: Extension
Component: WysiwygPlugin
Branches: master
Reported By: GeorgeClark
Waiting For:
Last Change By: GeorgeClark
Foswiki 1.2 is supposed to use single quotes within HTML tags, and Double quotes within TML tags.

See HtmlAttributesShouldUseSingleQuotes

The Wysiwyg HTML2TML/Node.pm emits double quotes by default when converting HTML back into TML. And the unit tests expect this by using a finaltml= changing the expected delimiter to double-quotes.

Fix for this seems simple, to reverse the test in Node.pm

diff --git a/WysiwygPlugin/lib/Foswiki/Plugins/WysiwygPlugin/HTML2TML/Node.pm b/WysiwygPlugin/lib/Foswiki/Plugins/WysiwygPlugin/HTML2TML/Node.pm
index db18485..d5613d0 100644
--- a/WysiwygPlugin/lib/Foswiki/Plugins/WysiwygPlugin/HTML2TML/Node.pm
+++ b/WysiwygPlugin/lib/Foswiki/Plugins/WysiwygPlugin/HTML2TML/Node.pm
@@ -715,7 +715,7 @@ sub _htmlParams {
 
             $v = join( ' ', @classes );
         }
-        my $q = $v =~ /"/ ? "'" : '"';
+        my $q = $v =~ /'/ ? '"' : "'";     # Default to single quotes in HTML
         push( @params, $k . '=' . $q . $v . $q );
     }
     my $p = join( ' ', @params );

-- GeorgeClark - 22 Jan 2015

Looks good. I'd forgotten about the single/double debate.

-- CrawfordCurrie - 24 Jan 2015
 

ItemTemplate edit

Summary Wysiwyg defaults to double quotes when generating HTML tags.
ReportedBy GeorgeClark
Codebase
SVN Range
AppliesTo Extension
Component WysiwygPlugin
Priority Normal
CurrentState Closed
WaitingFor
Checkins distro:de1a335237aa
TargetRelease major
ReleasedIn 2.0.0
CheckinsOnBranches master
trunkCheckins
masterCheckins distro:de1a335237aa
ItemBranchCheckins
Release01x01Checkins
Topic revision: r5 - 05 Jul 2015, GeorgeClark
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy