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

Fix broken JS in xhtml #1548

Merged
merged 4 commits into from Jan 30, 2017
Merged

Fix broken JS in xhtml #1548

merged 4 commits into from Jan 30, 2017

Conversation

selfthinker
Copy link
Collaborator

When serving DokuWiki as XHTML there are some JavaScript errors. This fixes most of those errors mentioned in FS#2550.

I'll explain the issues further in the comments below.

@selfthinker
Copy link
Collaborator Author

selfthinker commented Apr 20, 2016

Re: the revisionBoxHandler, the issue was only with .attr('disabled', false) but I rewrote more bits that don't have anything to do with the initial issue.

Re: the footnoteDisplay, the issue was that the content that was put back via .html() was not stripped from the <sup> etc because that element included the xmlns attribute. E.g. the content of the footnote from the wiki:syntax page was this:

<sup xmlns="http://www.w3.org/1999/xhtml"><a href="#fnt__1" id="insitu__fn__1 class="fn_bot">1)</a></sup> 
This is a footnote

And using that in .html() would throw "SyntaxError: An invalid or illegal string was specified". Officially, .html() does not work with XHTML ("This method is not available on XML documents.") but it is otherwise working. I'm not sure but I guess it's the xmlns because XML documents might break if any snippets re-defining the namespace would arbitrarily be put anywhere willy-nilly?

@@ -147,7 +147,7 @@ function document_end() {
}

// add footnote markup and close this footnote
$this->doc .= $footnote;
$this->doc .= '<span class="content">'.$footnote.'</span>';
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we ever have block elements inside a footnote? If yes, then this should rather be a <div>.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I think we could.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed it to a div now.

I have to say it's difficult to restrain myself not improving the semantics here. But that makes more sense after the release (and in a different PR).

@Klap-in Klap-in added this to the Elenor of Tsort - coming release milestone Apr 30, 2016
@selfthinker selfthinker removed this from the Elenor of Tsort - coming release milestone Jun 6, 2016
@selfthinker selfthinker added this to the Frusterick Manners milestone Jan 29, 2017
@splitbrain splitbrain merged commit 9d2d084 into master Jan 30, 2017
@splitbrain splitbrain deleted the fix-broken-js-in-xhtml branch January 30, 2017 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants