You are here: Foswiki>Tasks Web>Item773 (24 Feb 2009, CrawfordCurrie)Edit Attach

Item773: Verbatim doesn't quote metadata

pencil
Priority: Normal
Current State: No Action Required
Released In:
Target Release:
Applies To: Extension
Component: WysiwygPlugin
Branches:
Reported By: TimotheLitt
Waiting For:
Last Change By: CrawfordCurrie
In editing http://foswiki.org/Tasks/Item767, I discovered that %META in a <verbatim> block is not quoted, and can cause really unfortunate effects.

In this case, it made it appear that some of the metadata (intended as an example) was interpreted as an attachment and was removed from the verbatim block.

As expected, only the data that was at the start of a line was so-impacted.

<verbatim> needs to quote %META.
Can you explain how you got the META into the verbatim block? Was it by typing into Tiny MCE?

-- CrawfordCurrie - 22 Feb 2009

I don't remember - it's been over a month. Editing Tasks now gets raw mode, but the entry was made 15-Jan. I suppose it would be useful if we had some edit history metadata (e.g. date, who, editor)...

If the Tasks web had Tiny MCE disabled on 15-Jan, then obviously it was with raw mode. Otherwise, can't say -- other than that I pasted the example from a debug=raw view of another topic to illustrate a bug. And, it looks like I initially assigned it to wysiwyg plugin - I wouldn't have done that unless I had been editing in Tiny MCE.

But there is a bug either way. However metadata-like text is entered by a user, save needs to scan for <verbatim> blocks and quote any apparent metadata within them.

One could make a case that a user shouldn't be able to directly enter metadata anywhere - but certainly verbatim should mean verbatim!!

-- TimotheLitt - 23 Feb 2009

I quite agree; I'm just trying to nail down if this is a WysiwygPlugin issue (which I can't find a way to reproduce) or a general Foswiki issue, for which I opened a new task last night Item1119. I suspect it's the general issue.

-- CrawfordCurrie - 23 Feb 2009

This is not a WYSIWYG issue, it is "per spec" (such as the spec has ever been). META embedded in verbatim is supposed to be extracted and added to the meta object. See Item1119 for further discussion on this issue. Please contribute further to the debate there.

-- CrawfordCurrie - 24 Feb 2009

mmm, while I agree it is 'as per spec' for T*, I don't actually agree that this is necessarily so for F*.

-- SvenDowideit - 24 Feb 2009

OK, so it's also a general issue. I just reproduced this in Sandbox with wysiwyg this way:

Enter newline, newline, %META... newline, %META... newline, newline in a new topic.

Select & apply Verbatim.

At least the second line will be saved as real metadata. Sometimes the first will have the verbatim tag on the same line as the first, or there will be a leading space. That prevents recognition. But the second and subsequent lines will be treated as true metadata. And that looks like how I first encountered it.

While it's a general issue, it does seem a bit more severe with WYSIWYG - in this case, what you see is very much NOT what you get (or expect.) Here a user has not only typed what he wants, but explicitly asked for it to be protected. Despite this, the software is acting as if the user's instructions don't matter. Maybe that's tolerable for someone coding in a markup language (TML), but I think it violates the user contract with WYSIWYG.

WYSIWYG is more than a name - it's a promise. So whatever happens with the general issue, I think that at least the WYSIWYG exporter should quote any %META entered by the user...especially in VERBATIM

Anyhow, my thoughts on the general issue are in your new item.

-- TimotheLitt - 24 Feb 2009

I sort-of agree with you, but also sort-of disagree. A verbatim block has a very specific meaning to Foswiki. The fundamental problem is Item1119; I believe WYSIWYG is treating verbatim blocks exactly as the "spec" requires. Quite aside from that, Foswiki verbatim blocks have no concept of additional protection for their contents - there is no way for me to add additional "escaping" in a verbatim block. All I could do would be to "defuse" a %META by - for example - adding a space before it, an act which itself violates the WYSIWYG contract.

Solve the core issue, and this symptom goes away.

-- CrawfordCurrie - 24 Feb 2009

ItemTemplate edit

Summary Verbatim doesn't quote metadata
ReportedBy TimotheLitt
Codebase
SVN Range Foswiki-1.0.0, Thu, 08 Jan 2009, build 1878
AppliesTo Extension
Component WysiwygPlugin
Priority Normal
CurrentState No Action Required
WaitingFor
Checkins
ReleasedIn
Topic revision: r8 - 24 Feb 2009, CrawfordCurrie
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