You are here: Foswiki>Tasks Web>Item2441 (04 Dec 2014, MichaelDaum)Edit Attach

Item2441: Using DpSyntaxHighlighterPlugin inside of an FormQueryPlugin SOWQUERY loop breaks DpSyntaxHighlighter javascript rendering

pencil
Priority: Low
Current State: Waiting for Feedback
Released In: n/a
Target Release: n/a
Applies To: Extension
Component: DpSyntaxHighlighterPlugin
Branches:
Reported By: JensDienst
Waiting For:
Last Change By: MichaelDaum
Using the DpSyntaxHighlighterPlugin inside of an Formquery SHOWQUERY Loop prints after every loop Element an "<script type=" and causes an Brush not found popup.

1 define service{   
2  use                        uplink   
3  hosts                      
4  service_description        PortStatus Gi 1   
5  servicegroups              uplink   
6  check_command              check_ifup!10101   
7 } 
<script type= 


The Error is caused from the $out print build in Line 115 of the DpSyntaxHighlighterPlugin.pm adding some additional Backslashes solves the Problem for me.

*** /root/dev/DpSyntaxHighlighterPlugin.pm      Wed Dec  2 17:07:38 2009
--- DpSyntaxHighlighterPlugin.pm        Wed Dec  2 17:47:48 2009
***************
*** 112,118 ****
      return "<span class='foswikiAlert'>$pluginName error: The language \"$lang\" is not supported.</span>"
          if $brush eq '';

!     $out .= "<script type=\"text/javascript\" src='$rootDir/scripts/shBrush$brush.js'></script>";

      _doHead();

--- 112,118 ----
      return "<span class='foswikiAlert'>$pluginName error: The language \"$lang\" is not supported.</span>"
          if $brush eq '';

!     $out .= "<script type=\\\"text/javascript\\\" src='$rootDir/scripts/shBrush$brush.js'></script>";

      _doHead();

-- JensDienst - 02 Dec 2009

An addition: using this workaround breaks the Plugin outside an SHOWQUERY Loop

-- JensDienst - 02 Dec 2009

you may want to try ' instead of " (escaped or not).

-- WillNorris - 02 Dec 2009

OK, changing this
$out .= "<script type=\"text/javascript\" src='$rootDir/scripts/shBrush$brush.js'></script>";
to this
$out .= "<script type=\'text/javascript\' src='$rootDir/scripts/shBrush$brush.js'></script>";

solves the Problem. -- JensDienst - 10 Dec 2009

Perhaps this plugin can implement a similar solution to EscapeQuotesOptionInICON, once that has been discussed.

-- AndrewJones - 06 Jan 2010

Please try again with the latest version 3.0

-- MichaelDaum - 04 Dec 2014

 

ItemTemplate edit

Summary Using DpSyntaxHighlighterPlugin inside of an FormQueryPlugin SOWQUERY loop breaks DpSyntaxHighlighter javascript rendering
ReportedBy JensDienst
Codebase 1.0.8, 1.0.7
SVN Range
AppliesTo Extension
Component DpSyntaxHighlighterPlugin
Priority Low
CurrentState Waiting for Feedback
WaitingFor
Checkins
TargetRelease n/a
ReleasedIn n/a
CheckinsOnBranches
trunkCheckins
masterCheckins
ItemBranchCheckins
Release01x01Checkins
Topic revision: r5 - 04 Dec 2014, MichaelDaum - This page was cached on 05 Jun 2020 - 17:42.

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