Anca Paula Luca wrote:
Hi devs,
starting from a Wysiwyg implementation issue, we had a discussion yesterday about marking links towards new pages in the wiki. Right now, a question mark ('?') text is appended to the end of the link label and coloured properly. I would like to change this into using exclusively css, for the following reason: * this question mark represents *styling only*: it's as if we'd colour links towards new pages with a different color (the way mediawiki does), therefore this information (either it's a qm, or colour or whatever) should *not appear as part of the document content*, the way a ? text does (the raw HTML contains it).
One method of doing this in CSS is appending the text itself (with :after pseudoelement), but that is not cross-browser, and the other method is using an image for the question mark.
I'm +1 for the image qm for 2 more reasons (besides the cross browser issue): * this information would not append to document content at all (e.g. if I copied the rendered document content in an ascii editor, I wouldn't have the ?) * it is a solution closer to the colour solution or marking the link to a new page with a non-character sign (see, for example, the way mediawiki marks external links) -- we can decide to change that anytime and we *don't have to change rendering rules* which makes very much sense to me.
Here's the issue on JIRA for this solution: http://jira.xwiki.org/jira/browse/XWIKI-2803
+11 for styling. +1 for a mixed solution, where an image is used only for stupid browsers (why do I say browsers? It's only one), and :after is used for the rest of them. .createLink { background:... padding-right:... cue-before: url("sayBrokenLink.wav"); /* this is important, too */ } * > .createLink { background-image: none; padding-right: 0; } .createLink:after { content:... } The image is not such a great idea because it can't be scaled, it won't always match the client font, and it won't be displayed when images are somehow unavailable. If a user has different fonts on his machine, the qm will look oddly different. If she increases or decreases the font, the image will stay the same and might even be cropped for smaller font sizes. If images are disabled, then there's no indication that the link is not valid. I wouldn't even mind if we use :after alone, since I don't give a penny about IE6 and its users. CSS is cross browser, it just happens that IE is not really a browser. -- Sergiu Dumitriu http://purl.org/net/sergiu/