-
Notifications
You must be signed in to change notification settings - Fork 10
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
Comments
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 |
I don't see the correlation between embedded applications e target attributes. 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 |
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 |
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:
|
Docet strip away anchor
target
attributes throughJsoup.clean(dirtyPageText, whiteList);
Permitting
target
attribute we can link external resources in another pageThe text was updated successfully, but these errors were encountered: