Commits

ms2ger  committed 061718e Merge

Merged in zcorpan/anolis/support-data-x (pull request #12)

Support data-x=''

  • Participants
  • Parent commits 9021d38, c2f1273

Comments (0)

Files changed (4)

File anolislib/processes/xref.py

                 w3c_compat_xref_normalization=False, **kwargs):
         if element.get("data-anolis-xref") is not None:
             term = element.get("data-anolis-xref")
+        elif element.get("data-x") is not None:
+            term = element.get("data-x")
         elif element.get("title") is not None:
             term = element.get("title")
         else:

File anolislib/processes/xspecxref.py

               w3c_compat_xref_normalization=False, **kwargs):
     if element.get("data-anolis-xref") is not None:
       term = element.get("data-anolis-xref")
+    elif element.get("data-x") is not None:
+      term = element.get("data-x")
     elif element.get("title") is not None:
       term = element.get("title")
     else:

File tests/xref-data-x.html

+<!DOCTYPE html><meta charset=utf-8><p><dfn id=foobar>foobar</dfn></p>
+<p><dfn id=lol>lol</dfn></p>
+<p><a data-x=lol href=#lol title=foobar>foobar</a></p>

File tests/xref-data-x.src.html

+<!doctype html>
+<p><dfn>foobar</dfn></p>
+<p><dfn>lol</dfn></p>
+<p><span title="foobar" data-x="lol">foobar</code></p>