Modify

Opened 17 years ago

Closed 4 years ago

#1712 closed defect (wontfix)

source:trunk/path/to/somewhere links do not become links in the pdf

Reported by: blyth@… Owned by: chenca
Priority: normal Component: Trac2LatexPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.10

Description

the subject says it all, almost ... it would be great if all the TracLinks were propagated as links into the pdf, especially :

source:trunk/path/to/somewhere

trying to visit TracLinks with ?format=tex to see what is supported gives an error :

LATEX PARSER ERROR: 'charmap' codec can't encode character u'u2014' in position 157: character maps to

Attachments (0)

Change History (2)

comment:1 Changed 17 years ago by anonymous

I made the links work to some extent by, a small change in trac2latex.py ... I hope this might help you with a cleaner solution

def _make_link(self, ns, target, match, label):
        # first check for an alias defined in trac.ini
        ns = self.env.config.get('intertrac', ns) or ns
        if ns in self.wiki.link_resolvers:
        #  
        # SCB pragmatic approach ... do a match on the "a" tag to get the href 
        #
        #   
        #   scbrez=self.scb_atagre.match(atag)
        #   if scbrez:
        #       return r"%s %s " % ( scbrez.group(1) , scbrez.group(2) )
        #   else:
            atag_element = self.wiki.link_resolvers[ns](self, ns, target, escape(label, False))
            atag_text = r"%s" % atag_element
            atag_bits = split(atag_text,"\"")
            return self._make_hf_ext_link( atag_bits[3] , label )
        elif target.startswith('//') or ns == "mailto":
            return self._make_ext_link(ns+':'+target, label)
        else:
            return self._make_intertrac_link(ns, target, label) or \
                   self._make_interwiki_link(ns, target, label) or \
                   match

    def _make_hf_ext_link(self, url, text, title=''):
        text = self._latexescape_comments(text, None)
        url = self._latexescape_comments(url, None)
        if text == url:
            return r"\hfurl{%s}" % url
        else:
            return r"\hfhref{%s}{%s}" % (url, text)

comment:2 Changed 4 years ago by Ryan J Ollos

Resolution: wontfix
Status: newclosed

Deprecated and removed.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain chenca.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.