Santhosh has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/392794 )
Change subject: Remove the left out data-seqid usage
......................................................................
Remove the left out data-seqid usage
In I9272a9bda265de5e(June 26) we removed the usage of data-seqid.
But somehow missed to remove it from the id calculation part with
hash. Removing it.
Heading tags were getting ids like undefinede5e3bbf3b3d03ac50ee32298
This fixes that issue.
Change-Id: I23c49dee746f5734dae3c226a72ad5ec2aa7e5ad
---
M lib/lineardoc/Doc.js
1 file changed, 2 insertions(+), 6 deletions(-)
Approvals:
jenkins-bot: Verified
Nikerabbit: Looks good to me, approved
diff --git a/lib/lineardoc/Doc.js b/lib/lineardoc/Doc.js
index 30d2909..29b86fa 100644
--- a/lib/lineardoc/Doc.js
+++ b/lib/lineardoc/Doc.js
@@ -109,14 +109,10 @@
hash.update( this.items[ i + 1
].item.getPlainText() );
// 30 is the max length of ids we
allow. We also prepend the sequence id
// just to make sure the ids don't
collide if the same text repeats.
- tag.attributes.id = (
- tag.attributes[ 'data-seqid' ]
+ hash.digest( 'hex' )
- ).substr( 0, 30 );
+ tag.attributes.id = hash.digest( 'hex'
).substr( 0, 30 );
} else if ( tag.attributes.id.length > 30 ) {
// At any case, make sure that the
section id never exceeds 30 bytes
- tag.attributes.id = (
- tag.attributes[ 'data-seqid' ]
+ tag.attributes.id
- ).substr( 0, 30 );
+ tag.attributes.id =
tag.attributes.id.substr( 0, 30 );
}
} else {
tag.attributes.id = getNextId( 'block',
tag.name );
--
To view, visit https://gerrit.wikimedia.org/r/392794
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I23c49dee746f5734dae3c226a72ad5ec2aa7e5ad
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/services/cxserver
Gerrit-Branch: master
Gerrit-Owner: Santhosh <[email protected]>
Gerrit-Reviewer: Nikerabbit <[email protected]>
Gerrit-Reviewer: Santhosh <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits