Commits

Geoffrey Sneddon committed bec1b99

Support @data-anolis-xref when getting the xref term.

  • Participants
  • Parent commits 5414da5

Comments (0)

Files changed (3)

anolislib/processes/xref.py

 
     def getTerm(self, element, w3c_compat=False,
                 w3c_compat_xref_normalization=False, **kwargs):
-        if element.get(u"title") is not None:
+        if element.get(u"data-anolis-xref") is not None:
+            term = element.get(u"data-anolis-xref")
+        elif element.get(u"title") is not None:
             term = element.get(u"title")
         else:
             term = utils.textContent(element)

tests/basic/dfn-data-anolis-xref.html

+<!DOCTYPE html><head><meta charset=utf-8><p><dfn data-anolis-xref=foo id=foobar>foobar</dfn></p>
+<p><a href=#foobar>foo</a>

tests/basic/dfn-data-anolis-xref.src.html

+<!doctype html>
+<p><dfn data-anolis-xref="foo">foobar</dfn></p>
+<p><span>foo</span></p>