Ticket #283: ticket283_alt.patch

File ticket283_alt.patch, 466 bytes (added by FND, 4 years ago)

alternative implementation ensuring unique tiddler IDs

  • core/js/Story.js

    diff --git a/core/js/Story.js b/core/js/Story.js
    index 9a0b57b..4f6ad42 100644
    a b  
    1212        this.highlightRegExp = null; 
    1313        //# generate tiddler ID 
    1414        this.tiddlerId = function(title) { 
     15                var id = this.idPrefix + title; 
     16                while(document.getElementById(id)) { //# ensure ID is unique 
     17                        id += "_"; 
     18                } 
    1519                return this.idPrefix + title; 
    1620        }; 
    1721        this.containerId = function() {