[BACK]Return to code.pod CVS log [TXT][DIR] Up to [cvsweb.bsd.lv] / pod2mdoc / Regress / formatcode

File: [cvsweb.bsd.lv] / pod2mdoc / Regress / formatcode / code.pod (download)

Revision 1.1, Fri Jul 18 05:09:33 2014 UTC (9 years, 9 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_0_2, VERSION_0_1, VERSION_0_0_13, HEAD

Proper translation of POD escape sequences into mdoc macros,
including correct whitespace handling.
This is surprisingly hard to get right.

The main idea is to not write Ns at the end of formatcode(),
but instead clear the wantws state and let the caller parse
ahead (in the manner required by the context) to see what is
following, then break the line or print Ns as appropriate.

Also use the following logic throughout:
* Clear wantws after writing a non-whitespace character.
* Switch to text state after flushing text output.
* Switch back to OUST_NL/wantws after a line break.

=head1 NAME

code - code escape sequences

=head1 DESCRIPTION

beforeC<code>after

before C<code> after

first secondC<code>

B<bold>C<code>normal

B<bold> C<code> normal

B<bold >C<code>