Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 364427

Summary: [mediawiki] HTML styles in link title are not rendered in the editor source view
Product: z_Archived Reporter: Miles Parker <milesparker>
Component: MylynAssignee: Project Inbox <mylyn-triaged>
Status: RESOLVED WONTFIX QA Contact: David Green <greensopinion>
Severity: normal    
Priority: P3    
Version: 1.5   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
mylyn/context/zip none

Description Miles Parker CLA 2011-11-21 19:35:38 EST
The following text is legal mediawiki:

*[[example|<span style="color:green;">This page exists.</span>]]
*[[exampl|<span style="color:green;">This page does not exist.</span>]]

See: http://en.wikipedia.org/wiki/Wikipedia:Link_color

It should render both links in green. Instead, the Wikitext Preview renders them as if they were non-wiki text.
Comment 1 David Green CLA 2011-11-22 14:27:29 EST
Thanks for the bug.

To clarify: the markup preview renders correctly, however the source view doesn't apply the span styles.
Comment 2 David Green CLA 2011-11-22 22:08:12 EST
It turns out that this one would be quite a lot of effort to implement correctly.  The main obstacles here are:
* MediaWiki allows for arbitrary begin/end tags, which need not match up or be well-formed (they could be nested SGML-style)
* Mylyn WikiText currently recognizes these tags and just passes them through as unescaped text to the builder
Generally MediaWiki is a pretty poor markup language when it comes to this kind of tooling support.

Given the effort involved, marking as WONTFIX.  Feel free to reopen if you're interested in contributing a patch.  I've marked the relevant code in the attached context.
Comment 3 David Green CLA 2011-11-22 22:08:14 EST
Created attachment 207394 [details]
mylyn/context/zip
Comment 4 Miles Parker CLA 2011-11-22 23:10:46 EST
Yeah, I'm fine with that resolution as well. Basically I just need some way to get some kind of styling label across the transom and if something like bug 364531 works, that's the proper way to do things anyway. It's silly to be putting the actual styling into the wikitext itself.

(In reply to comment #2)
> Generally MediaWiki is a pretty poor markup language when it comes to this kind
> of tooling support.

I was beginning to get that impression. It seems that it is pretty tolerant/loose with formalisms.

David, is there another supported markup language that you think would work better? I'm not tied to mediawiki though I think it would have to have a wiki flavor. Too much work at this point to go to textile. The main reason I've been using mediawiki is to be able to move back and forth between eclipse and other wikis and the internal docs, but that's not such a big issue in this case.
Comment 5 David Green CLA 2011-11-23 17:02:42 EST
(In reply to comment #4)
> David, is there another supported markup language that you think would work
> better? I'm not tied to mediawiki though I think it would have to have a wiki
> flavor. Too much work at this point to go to textile. The main reason I've been
> using mediawiki is to be able to move back and forth between eclipse and other
> wikis and the internal docs, but that's not such a big issue in this case.

It's really whatever is working best for you.  Textile is definintely the best supported markup language within Mylyn WikiText.   I'd say stick with what you've got.  

If you're interested in a move to Textile and the only obstacle is converting markup, then Mylyn WikiText might be able to help you with that.  Recently we've added support for generating markup using the same @DocumentBuilder@ interface as we use for generating HTML, DocBook, etc. (see bug 357294), which makes it somewhat trivial to convert from one markup language to another.  The only thing we haven't done there is add Ant tasks or UI affordances for doing the conversion.