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

Word Content Handler Bugfixes #1079

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions build/ctct-word-content-handler-changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- **BUGFIX**: Word Content Handler
Replace Word specific <o:p/> tags with <br/> tags.
Unwrap paragraph tags so that the visual double space does not appear
8 changes: 8 additions & 0 deletions src/plugins/common/contenthandler/lib/wordcontenthandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,14 @@ define([
// Because footnotes for example are wrapped in divs and should
// be unwrap.
$node.contents().unwrap();
} else if ('o:p' === nodeName) { // Word specific character
// Remove the <o:p> tags. It seems to stand for a new line
$node.replaceWith('<br>');
} else if ('p' === nodeName) {

// Unwrap the paragraph tags so that the visual double space
// does not appear
$node.contents().unwrap();
} else if ('td' !== nodeName && isEmpty($node)) {

// Because any empty element (like spaces wrapped in spans) are
Expand Down