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 namespace error message #165

Merged
merged 1 commit into from
Feb 26, 2014
Merged

Conversation

izak
Copy link

@izak izak commented Feb 18, 2014

The problem snuck in after I fixed the double-body problem some time ago. By using the innerHTML of the body instead of serializing the body, I ended up with a xmlns on every top level element inside the body.

When you hit enter in Aloha, it makes a copy of whatever element it's in. It also copies all the attributes. It didn't like copying xmlns, hence the error message.

This fixes the problem using somewhat of a sledgehammer approach. It parses the body/head out using regex. Normally that's a bad idea for html, but here we use fresh html from XMLSerializer, so it should be safe.

@philschatz
Copy link
Member

🍰

@kathi-fletcher
Copy link
Member

Not really working for me.

I branched from master and merged in this branch. Then I opened the test book and entered a new line beneath the first paragraph in the first module that opens: http://33.33.33.10/#repo/oerpub/test-book/edit/content/02-Momentum-and-impulse.section-01.html|content/siyavula-physics-12.opf

This produced the namespace error.

I tried it in the second module titled "Momentum" and did not get the error.

When back to "Introduction to Momentum" and still got the error.

Tried "Add a module" to see if it happens in a new module and everything went dark. Not sure if that is relevant or not.

@kathi-fletcher
Copy link
Member

I bet the problem is with content that already has the bad namespaces. That causes more to get generated.

@izak
Copy link
Author

izak commented Feb 20, 2014

I bet Phil is right!

Should be as simple as killing them all parse time.

@kathi-fletcher
Copy link
Member

I think we should merge this to avoid getting more of these in the content. But I would still like to clean up the old ones.

kathi-fletcher added a commit that referenced this pull request Feb 26, 2014
@kathi-fletcher kathi-fletcher merged commit 58f7778 into master Feb 26, 2014
@kathi-fletcher kathi-fletcher deleted the fix-aloha-namespace-error branch February 26, 2014 16:24
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

Successfully merging this pull request may close these issues.

3 participants