Changeset 3115:632f96fc103a in livinglogic.python.xist

Show
Ignore:
Timestamp:
01/06/08 01:00:10 (12 years ago)
Author:
Walter Doerwald <walter@…>
Branch:
default
Message:

Add support for substitution references (using entities from the abbr module).

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/ll/xist/ns/doc.py

    r3114 r3115  
    3737import ll 
    3838from ll.xist import xsc, parsers, sims, xfind 
    39 from ll.xist.ns import html, docbook, fo, specials, xml 
     39from ll.xist.ns import html, docbook, fo, specials, xml, abbr as abbr_ 
    4040 
    4141 
     
    15861586        elif isinstance(node, nodes.emphasis): 
    15871587            return em(self.convert(child) for child in node.children) 
     1588        elif isinstance(node, nodes.substitution_reference): 
     1589            try: 
     1590                return getattr(abbr_, node.attributes["refname"].lower())() 
     1591            except AttributeError: 
     1592                return xsc.Frag(self.convert(child) for child in node.children) 
    15881593        elif isinstance(node, nodes.reference): 
    15891594            e = link(self.convert(child) for child in node.children)