Foswiki on GitHub is open for business! Next release meeting: Monday October 13, 1300Z

Item11051: chili syntax highlighter problem with Firefox 7 and "Rev. 6-17-2011 Safari" (5.1)

Priority: CurrentState: AppliesTo: Component: WaitingFor:
Normal Closed Extension JQueryPlugin  

  • Faq58 shows: :
    Screen_shot_2011-08-17_at_11.44.03_PM.png
-- HarlanStenn - 18 Aug 2011

See also Item11165

-- PaulHarvey - 03 Oct 2011

From Item11165:
With <verbatim class="tml"> I get wiki syntax nicely coloured. This bases on jQuery chili and a tml recipe: \pub\System\JQueryPlugin\plugins\chili\recipes\tml.js. Latest Firefox seem to not like the tml recipe and as Chili works still perfect with html, I do believe its a Foswiki bug.

As the two following samples do not contain any Foswiki mark up, the output should look the same:

verbatim class="html"
<a href="http://www.foswiki.org/">Foswiki</a>

verbatim class="tml"
<a href="http://www.foswiki.org/">Foswiki</a>

I get for class="tml" on Firefox 7 (simulated)
<a href="rg/">Foswiki</a>

-- AndreLichtsteiner - 03 Oct 2011

There's no reason for this to block 1.1.4; but it is serious because the recent browsers are preventing users from reading their System documentation.

Besides, we can update JQueryPlugin separately to Foswiki itself.

Sadly, chili looks dead, and I've wasted an hour trying to fix this without getting anywhere.

We should probably switch to something actively developed, like http://www.steamdev.com/snippet/ or http://google-code-prettify.googlecode.com/. On the bright side, they both highlight perl

-- PaulHarvey - 22 Oct 2011

Created a Foswiki TML definition for shjs/snippet/src-highlite at https://github.com/csirac2/src-highlite-foswiki

Some output (note the correct highlighting of elements and not the strange default colours & styles smile

%SEARCH{
   "info.date >= d2n('2009-01-01') AND info.date <= d2n('2009-12-31')"
   type="query"
   limit="20"
   format="   * $percentICON{
      \"$percentIF{
         \"'$topic'/parent.name='UserDocumentationCategory'\"
         then=\"info\"
         else=\"gear\"
      }$percent\"
   }$percent [[$topic]]"
}%
---++ List of FAQs
<!-- This search looks in the %SYSTEMWEB% and %USERSWEB% for FAQ topics, which
 are recognised because they have the form 'FAQForm' and are classified
 as type 'FrequentlyAskedQuestion' -->
%SEARCH{
    "form.name~'*FAQForm'"
    type="query"
    excludetopic="FAQTemplate"
    nonoise="on"
    web="%SYSTEMWEB%,%USERSWEB%"
    format="   * $formfield(TopicSummary) [[$web.$topic][Answer]]"
    header="$n$n()FAQ topics found in [[$web.WebHome][$web]] web:$n$n"
}%
</pre>
<pre class="tml">
%INCLUDE{
    "%QUERY{
        "'%SYSTEMWEB%.FAQWhatIsWikiWiki'/TopicClassification"
    }%"
    section="Summary"
}%
   * Set THETOPIC = %SYSTEMWEB%.FAQWhatIsWikiWiki
   * Set THEFIELD = TopicClassification
</pre>

Michael, your thoughts?

I was thinking we should create a new JQueryPrettyCode which is a pseudo-module that will load one of chili, shjs, snippet, google code-prettifier to do the actual work.

Your thoughts on choice of highlighter lib? There is codemirror too smile

-- PaulHarvey - 23 Oct 2011

I got Michael's feedback, and we agreed on a way forward: make a new impl-neutral pseudo-JQuery module, Eg. prettycode which in future will use whatever code prettifier of the month to do the work.

In the meantime though, there's no point having system documentation that's unreadable. Chili needs to be disabled for 1.1.4

-- PaulHarvey - 24 Oct 2011

There are lots of people out there using chili for their docu. If firefox 7 now starts to shred it, no matter where the error comes from, then this is a release blocker. On plus minus, chili is abandoned upstream.

I tried to grok and fix the tml recipe without success. It seems there is some sort of error related to the recursive call to _main in the recipe.

So we need to action here the sooner the better.

Good thing is, we have Paul to rescue us all giving us JQueryPrettyCode, which will not only fix highlightning tml in firefox but comes with a lot more syntax modes as well, i.e. a perl mode.

Please go ahead and check in the new prettifier

Things to do:

  • direct use of chili (not via prettycode) should be deprecated immediately and switched off in Config.spec
  • add a config variable to chose the backend: chili, google code-prettifier, maybe later codemirror or ace as well
  • default to google code-prettifier backend
  • the new prettifier interacts the same way with topics as chili does by using verbatim blocks and their class attribute to select the syntax mode
  • syntax modes may have different names on the various backends, so we need a way to map them onto the same name users can chose from ... starting with the chili recpipe names that we have now extending the set of modes from there
  • JQREQUIRE{chili} should become an alias to JQREQUIRE{prettycode}

-- MichaelDaum - 25 Oct 2011

Probably a Firefox bug after all!

In the latest Firefox 8 Beta syntax highlighting works as it used up to Firefox 6.

-- AndreLichtsteiner - 27 Oct 2011

Indeed. https://bugzilla.mozilla.org/show_bug.cgi?id=692441 and https://bugzilla.mozilla.org/show_bug.cgi?id=683838

-- PaulHarvey - 28 Oct 2011

We are getting more reports of system docs being corrupted due to Chili - I've disabled that plugin on foswiki.org, and reloaded apache.

-- GeorgeClark - 28 Oct 2011

Chili works fine again with Firefox-8.0

-- MichaelDaum - 07 Nov 2011

I still think we need to strongly consider a replacement. It fails on two browsers in somewhat common use, and the failure is subtle, quietly giving the user incomplete examples from our documentation. It also appears that Chili is not being maintained. IMHO, we either need to disable Chili by default, or replace it with something that works uniformly or fails in such a way that text is not hidden.

-- GeorgeClark - 08 Nov 2011

I totally agree, though I am happy users have a fixed firefox now. Regexes not working as expected was not sounding good at all. Can't say what's up with Safari nor when they fix it any time soon.

-- MichaelDaum - 08 Nov 2011

IIRC the busted Safari uses the same 'YARR' regex engine as FF7.

-- PaulHarvey - 08 Nov 2011

OIC. Any other browser using that version of YARR?

-- MichaelDaum - 09 Nov 2011

I've added config checkers for all of the deprecated JQuery plugins, along with a warning about incompatible browsers if Chili is enabled. Changed the default to disabled for Chili in 1.1.4. Do we want to close this one and open a new one for an eventual replacement of Chili?

-- GeorgeClark - 15 Nov 2011

We can close this, continued in Item11254

-- PaulHarvey - 15 Nov 2011

Can't see why creating YABI (yet another bug item) helps to get things done, but okay.

-- MichaelDaum - 16 Nov 2011

Just looking at the screenshots doesn't reveal the bug, unless you know the topic by hearts, or have chili at hand to try them out.

The bugs is that text gets removed from display. So
%STARTSECTION{type="templateonly"}%
becomes
%STARTSECTION{type="nly"}%

The bug still occurs on Safari 5.1.2. But it is fixed on latest nightly build of WebKit, r108593.

-- ArthurClemens - 23 Feb 2012

Chrome, also based on WebKit, never had this problem. Is this really a WebKit bug, or do you refer to the latest build of Safari?

-- MichaelDaum - 24 Feb 2012
 

ItemTemplate edit

Summary chili syntax highlighter problem with Firefox 7 and "Rev. 6-17-2011 Safari" (5.1)
ReportedBy HarlanStenn
Codebase 1.1.4 beta2, 1.1.4 beta1, 1.1.3, 1.1.3 RC1, 1.1.3 beta1, trunk
SVN Range
AppliesTo Extension
Component JQueryPlugin
Priority Normal
CurrentState Closed
WaitingFor
Checkins distro:853c331e2e63 distro:98d81255421f distro:ae5150457747 distro:cb002fae381a distro:210b5d3bc651
TargetRelease patch
ReleasedIn n/a
CheckinsOnBranches
trunkCheckins distro:98d81255421f distro:ae5150457747
Release01x01Checkins distro:853c331e2e63 distro:cb002fae381a distro:210b5d3bc651
Topic attachments
I Attachment Action Size Date Who Comment
Screen_shot_2011-08-17_at_11.43.24_PM.pngpng Screen_shot_2011-08-17_at_11.43.24_PM.png manage 265.1 K 18 Aug 2011 - 06:45 HarlanStenn TemplateTopics: Macro notes: ...
Screen_shot_2011-08-17_at_11.44.03_PM.pngpng Screen_shot_2011-08-17_at_11.44.03_PM.png manage 261.2 K 18 Aug 2011 - 06:46 HarlanStenn Faq58 shows:
Topic revision: r28 - 24 Feb 2012, MichaelDaum
 
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. see CopyrightStatement. Creative Commons License