acdlite / acdlite/jquery.sidenotes

refMarkId == null

Offen
#6 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
CoffeeScript
Sterne
77
Forks
12
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

hi I had an issue with refMarkId being null. This causes the script to terminate.
In my case the root cause was actually a plugin in CKeditor generating the footnotes with the id on $('sup a')
eg.

``` html



2


```

In your script the method refMark() on line 275 is used to retrieve the refMarkId variable, this method will return the "sup" tag as soon as it is found ignoring the "a" tag, which is actually strange considering the fact that the "a" tag is usually inside the "sup" tag, anyways I didn't want to change this method as it seems to be used a lot, I fixed my little problem by changing line 226 from

``` javascript
this.refMarkID = this.refMark().attr('id');
```

to

``` javascript
this.refMarkID = this.refMark().attr('id');
if (this.refMarkID == null)
this.refMarkID = this.$refMarkAnchor.attr('id');
```

I hope this helps you solve this problem the proper way.

Otherwise great script. :)

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.