From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from krisdoz.my.domain (kristaps@localhost [127.0.0.1]) by krisdoz.my.domain (8.14.5/8.14.5) with ESMTP id s37Bk5Hn032730 for ; Mon, 7 Apr 2014 07:46:06 -0400 (EDT) Received: (from kristaps@localhost) by krisdoz.my.domain (8.14.5/8.14.3/Submit) id s37Bk34X019973; Mon, 7 Apr 2014 07:46:03 -0400 (EDT) Date: Mon, 7 Apr 2014 07:46:03 -0400 (EDT) Message-Id: <201404071146.s37Bk34X019973@krisdoz.my.domain> X-Mailinglist: mdocml-source Reply-To: source@mdocml.bsd.lv MIME-Version: 1.0 From: kristaps@mdocml.bsd.lv To: source@mdocml.bsd.lv Subject: pod2mdoc: Allow (ignored) nested escapes in L<>. X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Log Message: ----------- Allow (ignored) nested escapes in L<>. Modified Files: -------------- pod2mdoc: pod2mdoc.1 pod2mdoc.c Revision Data ------------- Index: pod2mdoc.c =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/pod2mdoc/pod2mdoc.c,v retrieving revision 1.22 retrieving revision 1.23 diff -Lpod2mdoc.c -Lpod2mdoc.c -u -p -r1.22 -r1.23 --- pod2mdoc.c +++ pod2mdoc.c @@ -187,12 +187,18 @@ trylink(const char *buf, size_t *start, * Scan to the start of the terminus. * This function is more or less replicated in the formatcode() * for null or index formatting codes. + * However, we're slightly different because we might have + * nested escapes we need to ignore. */ stack = 0; for (linkstart = realend = *start; realend < end; realend++) { + if ('<' == buf[realend]) + stack++; if ('>' != buf[realend]) continue; - else if (dsz == 1) + else if (stack-- > 0) + continue; + if (dsz == 1) break; assert(realend > 0); if (' ' != buf[realend - 1]) Index: pod2mdoc.1 =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/pod2mdoc/pod2mdoc.1,v retrieving revision 1.12 retrieving revision 1.13 diff -Lpod2mdoc.1 -Lpod2mdoc.1 -u -p -r1.12 -r1.13 --- pod2mdoc.1 +++ pod2mdoc.1 @@ -262,6 +262,3 @@ escape is discarded. Unless solely a section link, the text and section parts of .Li L are discarded. -Moreover, nested format codes, e.g. -.Li L|bar> , -are not supported. -- To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv