Hi Paul,
Check out the page source and you'll see
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
so we don't generate HTML4 nor HTML5. We generate XHTML 1.0 strict and
so we must follow its rules which don't allow the "target" attribute.
Simple.
Whether the target attribute is good or bad is still on debate. I
prefer not to use it.
Using the rel attribute is just a workaround if you _really_ need to
control where the link should open (but the user should decide this!).
What we do is replace the rel attribute with target on the client side
with some JavaScript help. This way the page source remains XHTML
strict valid and the behaviour is present on the client (if you have
JavaScript enabled).
I'm against using/advertising the target attribute without changing
the doctype, and changing the doctype is complex. We want to move to
HTML5 but we haven't found yet the tools to validate our source
(similar to what we do now).
Hope this helps,
Marius
On Fri, Nov 8, 2013 at 4:53 PM, Paul Libbrecht <paul(a)hoplahup.net> wrote:
Hello XWiki community,
The current syntax 2.1 allows me to use
[[ link-label >>
http://example.com || target="targ"]]
so as to write a link that goes to a named target targ (which could also be
"_blank").
However, both XWiki Syntax 2.1 documentation for links:
http://platform.xwiki.org/xwiki/bin/view/Main/XWikiSyntax#HXWikiSyntax2.1Li…
and the WYSIWYG editor employ the rel attribute instead to denote that a link should be
opened in a new window.
I am surprised such a choice is made since:
- the rel attribute is deemed to be only useful for robots (see, e.g.
http://www.w3.org/TR/html401/struct/links.html#adef-rel,
http://dev.w3.org/html5/markup/a.html#a.attrs.rel,http://reference.sitepoin…
or
http://www.htmlhelp.com/reference/html40/values.html#linktypes)
- the target attribute which was deprecated in html4 has been resurrected by hmtl5 and is
indeed output by:
[[ link-label >>
http://example.com || rel="__blank"]]
I would suggest:
- to modify the syntax documentation to speak about the target attribute as well as the
rel attribute (e.g. with the nofollow attribute)
- to let the wysiwyg editor output target="_blank" instead of including the rel
nae
Do you agree?
It appears that I need particular rights to edit the XWikiSyntax page. How do I get
them?
thanks in advance.
Paul
_______________________________________________
devs mailing list
devs(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs