Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Permit anchor target attribute #29

Open
diegosalvi opened this issue Aug 31, 2017 · 4 comments
Open

Permit anchor target attribute #29

diegosalvi opened this issue Aug 31, 2017 · 4 comments

Comments

@diegosalvi
Copy link
Contributor

Docet strip away anchor target attributes through Jsoup.clean(dirtyPageText, whiteList);

Permitting target attribute we can link external resources in another page

@eolivelli
Copy link
Contributor

I think this is not so trivial, because we need to handle that target attribute explicitly, Docet is meant to be embedded in host web applications and it is not so clear the behavior.

The first idea is to have a configuration option to "allow" such elements at runtime, maybe the better place is in Docet JS-side configuration

/cc @mcRoot

diegosalvi added a commit to diegosalvi/docetproject that referenced this issue Aug 31, 2017
@diegosalvi
Copy link
Contributor Author

I don't see the correlation between embedded applications e target attributes.
By now Docet rally don't handle anchor targets just clean such attributes if present.

I think that Docet should let the user to create a link on another page, is up to the use then manage in the right way the target attribute

@eolivelli
Copy link
Contributor

My point is that Docet in theory does not let you write free HTML but you are writing in Docet-ML, which is very like to HTML, every HTML element/attribute is to be handled explicitly.

So you asking for a feature like "open this link in a new page", and the common way to achieve it in HTML is to use the 'target' attribute and I think we will go that way.

We should also specify the behavior for such links for PDF documents

@mcRoot
Copy link
Contributor

mcRoot commented Sep 20, 2017

To summarize the whole thread of comments, we agree on the fact that Docet's ML is not HTML, as such letting users exploit freely target attributes on anchors would lead to unpredictable runtime behavior, expecially when it comes to anchors to internal pages. As such, at most, we eventually agreed on the fact to let users adopt target attribute only when the referred to page is external. To make sure noone is able to adopt target on internal resource, we need to:

  • enforce checks at validation-time in the Docet Maven Plugin

  • make sure that also runtime engine checks that no target attribute is present on anchors to internal pages so as to cope with potential tampering of pages within documentation packages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants