Skip to content

Instantly share code, notes, and snippets.

@subbuss
Created January 14, 2019 18:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save subbuss/66d1241154090f9fff5358eb730ccc88 to your computer and use it in GitHub Desktop.
Save subbuss/66d1241154090f9fff5358eb730ccc88 to your computer and use it in GitHub Desktop.
[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