Skip to content
This repository has been archived by the owner on Apr 10, 2023. It is now read-only.

Commit

Permalink
Fixed bug where the plonebrowser dialog wouldn't properly populate th…
Browse files Browse the repository at this point in the history
…e anchors if the HTML5 schema was used
  • Loading branch information
Marc Sommerhalder committed Jan 28, 2016
1 parent 21c30d1 commit 258588c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
4 changes: 3 additions & 1 deletion HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ New:

Fixes:

- *add item here*
- Fixed bug where the plonebrowser dialog wouldn't properly populate the
anchors if the HTML5 schema was used.
[msom]


1.3.17 (2016-01-08)
Expand Down
11 changes: 9 additions & 2 deletions Products/TinyMCE/browser/atanchors.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def fromstring(text):

SEARCHPATTERN = "*/a"


class ATAnchorView(BrowserView):
implements(IAnchorView)

Expand All @@ -38,5 +39,11 @@ def listAnchorNames(self, fieldname=None):
raise
except Exception:
return []
return [anchor.get('name') for anchor in tree.findall(SEARCHPATTERN)
if "name" in anchor.keys()]

anchors = []
for anchor in tree.findall(SEARCHPATTERN):
if "name" in anchor.keys():
anchors.append(anchor.get('name'))
if "id" in anchor.keys():
anchors.append(anchor.get('id'))
return anchors

0 comments on commit 258588c

Please sign in to comment.