Created
January 14, 2019 18:56
-
-
Save subbuss/66d1241154090f9fff5358eb730ccc88 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[subbu@earth:~/work/wmf/parsoid/lib] git diff | |
diff --git a/lib/ext/Cite/index.js b/lib/ext/Cite/index.js | |
index c08e2cf14..f4d4d8991 100644 | |
--- a/lib/ext/Cite/index.js | |
+++ b/lib/ext/Cite/index.js | |
@@ -113,8 +113,8 @@ Ref.prototype.serialHandler = { | |
// Add b/c protection -- older revisions don't have 'primary' property set | |
if (haveUpdatedHtml(env)) { | |
const emitHtml = | |
- (dataMw.attrs.name && (dataMw.primary || dataMw.dupe)) || | |
- (!dataMw.attrs.name && (!dataMw.body.id || !isEmptyDOM(getRefBody(env, node, dataMw.body.id)))); | |
+ (dataMw.attrs && dataMw.attrs.name && (dataMw.primary || dataMw.dupe)) || | |
+ ((!dataMw.attrs || !dataMw.attrs.name) && (!dataMw.body.id || !isEmptyDOM(getRefBody(env, node, dataMw.body.id)))); | |
if (!emitHtml) { | |
// This is NOT a primary named ref | |
// Self-close it. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment