Hi rch,

The txt2tags URL parser is conservative, to avoid matching false positives,
such as normal punctuation right after a URL.

The solution you found works by escaping punctuation before de URL parsing
(with preproc) and restoring them after conversion (postproc).

Another alternative to avoid funky URLs is to save them in an "URL bank"
made by series of postprocs. Example:

    %!postproc: URL01  http://example.com/foo
    %!postproc: URL02  http://example.com/bar
    %!postproc: URL03  http://example.com/baz
    ...

And in the text body, you make links using those names instead of URLs:

    - [My homepage URL01]
    - [Work stuff URL02]
    - [Weekend pictures URL03]
    - ...

A similar technique is used in the txt2tags website, on the Children page.
The sources are here:

http://txt2tags.org/children.t2t



On Mon, Jul 27, 2015 at 4:40 AM, rch <r...@skynet.be> wrote:

> I wrote
>
> >Question
> >    How do I get text2tags to recognise the following
> >    problems as [description uri] ?
> >    … … …
>
> Off this list, a correspondent suggested to try the following:-
>
> %!preproc       : '!'  'AAAAA'
> %!preproc       : '\(' 'BBBBB'
> %!preproc       : '\)' 'CCCCC'
> %!preproc       : ';'  'DDDDD'
> %!preproc       : ':'  'EEEEE'
> %!preproc       : '#'  'FFFFF'
> %!preproc       : '\?' 'GGGGG'
> %!postproc      : 'AAAAA' '!'
> %!postproc      : 'BBBBB' '('
> %!postproc      : 'CCCCC' ')'
> %!postproc      : 'DDDDD' ';'
> %!postproc      : 'EEEEE' ':'
> %!postproc      : 'FFFFF' '#'
> %!postproc      : 'GGGGG' '?'
>
>     And that works!
>
>     All the *«The text2tags problem entries, format t2t»* at
>
> http://users.skynet.be/watermael/miscellaneous/In_asciidoc_they_all_work.html
>     now solved
>
>     With many thanks to my correspondent
>     and to txt2tags
>
>     Richard H
>
>
> ------------------------------------------------------------------------------
>
> _______________________________________________
> txt2tags-list mailing list
> https://lists.sourceforge.net/lists/listinfo/txt2tags-list
>
>


-- 
Aurelio | www.aurelio.net | @oreio
------------------------------------------------------------------------------
_______________________________________________
txt2tags-list mailing list
https://lists.sourceforge.net/lists/listinfo/txt2tags-list

Reply via email to