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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix(markdown): Space before quote (closes #786) #787

Merged
merged 1 commit into from May 26, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion js/core/markdown.js
Expand Up @@ -265,7 +265,7 @@ define([
.replace(/<p>\s*<\/p>/gm, "")
// beautifer has a bad time with "\n&quot;<element"
// https://github.com/beautify-web/js-beautify/issues/943
.replace(/\n&quot;</mg, " &quot;<");
.replace(/\n\s*&quot;</mg, " &quot;<");
var beautifulHTML = beautify.html_beautify(cleanHTML, beautifyOps);
newBody.innerHTML = beautifulHTML;
// Remove links where class pre.nolinks
Expand Down
16 changes: 16 additions & 0 deletions tests/spec/core/markdown-spec.js
Expand Up @@ -238,5 +238,21 @@ describe("Core - Markdown", function() {
expect(doc.querySelector("a[href='http://no-links-bar.com']")).toBeFalsy();
}).then(done);
});

it("it correctly handles quoted elements", function(done){
var ops = {
config: makeBasicConfig(),
body: makeDefaultBody() +
"<p id='test-text1'>outer text\n\"<code>inner text</code>\".</p>\n" +
"<p id='test-text2'>outer\n \"`inner`\".</p>"
};
ops.config.format = "markdown";
makeRSDoc(ops, function(doc) {
var text1 = doc.getElementById("test-text1").textContent;
expect(text1).toEqual("outer text \"inner text\".");
var text2 = doc.getElementById("test-text2").innerHTML;
expect(text2).toEqual("outer \"<code>inner</code>\".");
}).then(done);
});
});
});