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

Item12842: TOC links to headings containing !-escaped WikiWords or nop-escaped macros not properly filtered

Priority: Normal
Current State: Closed
Released In: 2.0.0
Target Release: major
Applies To: Engine
Component: EditChapterPlugin, FoswikiRender
Branches: trunk
Reported By: LeilaPearson
Waiting For:
Last Change By: GeorgeClark
The TOC link below to the heading with the !-escaped WikiWord doesn't work on my 1.1.9 site or on Michael's demo site (see It does work on this site though, and also on my site running trunk. Not sure if this means it is fixed in trunk or if it means something else - like a plugin or contrib installed both on my site and on Michael's demo site is somehow interfering? Any insights would be appreciated.

Normal heading

some text

Heading with WikiWord

more text

Heading with ! disabled WikiWord

even more text

Heading with <nop> disabled WikiWord

yet more text

Heading with <nop> disabled MACRO %I%

text again

Which error-behavior do you see? Can you rephrase "doesn't work" a bit, please?

Also, which browser did you test?

EditChapterPlugin might play a role as it heavily (too much maybe) processes headings. Try switching it on/off to see if that fixes the error you see.

Note also that foswiki-1.1.9 and trunk both render anchor targets differently.

-- MichaelDaum - 03 Apr 2014

By "doesn't work" I mean that when you click on the link it doesn't jump to the section on the page.

For the browser, I was using Chrome.

Thanks for the tip about EditChapterPlugin. I'll try that right away and get back to you.

You were right. EditChapterPlugin is the key here. Turning it off fixes this problem. It also fixes another problem where the heading doesn't display properly if it contains a <nop> disabled MACRO. Reclassifying this as a plugin issue.

-- LeilaPearson - 03 Apr 2014

Note also: you will have to be logged in to see the error. Otherwise EditChapterPlugin won't alter the headings and TOC works out fine.

-- MichaelDaum - 03 Apr 2014

This is actually an error in the core when creating link IDs.

Stuff like this isn't cleaned up properly even when EditChapterPlugin is disabled:

---++ Section 3 <a href="#" title="This is <nop>FooBar ">FooBar</a> EditChapterPlugin

See the < nested inside the <a ...>. Nesting is only valid for those Foswiki pseudo-html tags.

EditChapterPlugin's plainify method needs some improvements as well to weed out macros.

-- MichaelDaum - 04 Apr 2014

I installed the updated EditChapterPlugin version 4.64. I thought it might fix the issue with !-escaped WikiWords in headings but I'm still seeing problems on my site. The nop option does seem to work now though.

People really like EditChapterPlugin so I'm quite reluctant to disable it, and my site requires authentication so everyone is logged in so the plugin does come into play for everyone.

For example, I had the following:
---+++ How do I disable !WikiWord linking in text I enter?

When I look at the html for that anchor I see something like this:
<a name="How_do_I_disable_WikiWord_linking_in_text_I_enter_63_WikiWord_linking_in_text_I_enter_63_34_data_45web_61_34Main_34_data_45topic_61_34WikiFAQ_34_data_45from_61_3435_34_data_45to_61_3435_34_62"></a>

If I disable EditChapterPlugin it fixes the issue.

-- LeilaPearson - 30 Apr 2014

I don't see that it should be a release blocker for 1.2, so downgrading to Normal. ... Actually, this appears to have fixes checked in for both Render, and EditChapterPlugin, But no unit test for the changes to Render. So no idea if this is actually fixed or not.

Should this be set to Waiting for Release?

-- GeorgeClark - 19 Jun 2014

ItemTemplate edit

Summary TOC links to headings containing !-escaped WikiWords or nop-escaped macros not properly filtered
ReportedBy LeilaPearson
Codebase 1.1.9
SVN Range
AppliesTo Engine
Component EditChapterPlugin, FoswikiRender
Priority Normal
CurrentState Closed
Checkins distro:583469031479 EditChapterPlugin:9815d257f254
TargetRelease major
ReleasedIn 2.0.0
CheckinsOnBranches trunk
trunkCheckins distro:583469031479 EditChapterPlugin:9815d257f254
Topic revision: r12 - 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