<!DOCTYPE html>
<html lang='en'>
<head>
<title>ikiwiki/legacy - old ikiwiki engine, based on git.ikiwiki.info</title>
<meta name='generator' content='cgit v1.2.3'/>
<meta name='robots' content='index, nofollow'/>
<link rel='stylesheet' type='text/css' href='/cgit-css/cgit.css'/>
<link rel='stylesheet' type='text/css' href='/cgit-local/local.css'/>
<script type='text/javascript' src='/cgit.js'></script>
<link rel='shortcut icon' href='/favicon.ico'/>
<link rel='alternate' title='Atom feed' href='https://source.jones.dk/ikiwiki/legacy/atom/openid-selector_nb?h=master' type='application/atom+xml'/>
<link rel='vcs-git' href='https://source.jones.dk/ikiwiki/legacy' title='ikiwiki/legacy Git repository'/>
<link rel='vcs-git' href='user@source.jones.dk:ikiwiki/legacy' title='ikiwiki/legacy Git repository'/>
</head>
<body>
<div id='cgit'><table id='header'>
<tr>
<td class='logo' rowspan='2'><a href='/'><img src='/cgit-css/cgit.png' alt='cgit logo'/></a></td>
<td class='main'><a href='/'>index</a> : <a href='/ikiwiki/legacy/'>ikiwiki/legacy</a></td><td class='form'><form method='get'>
<input type='hidden' name='id' value='dba7d7b490a9347bf51f7f9bbb3869d7477cfe21'/><select name='h' onchange='this.form.submit();'>
<option value='_clean'>_clean</option>
<option value='_da'>_da</option>
<option value='_multilang'>_multilang</option>
<option value='_nb'>_nb</option>
<option value='_scs'>_scs</option>
<option value='allinone'>allinone</option>
<option value='allinone-da'>allinone-da</option>
<option value='allinone-multilang'>allinone-multilang</option>
<option value='allinone-nb'>allinone-nb</option>
<option value='clean'>clean</option>
<option value='da'>da</option>
<option value='master' selected='selected'>master</option>
<option value='multilang'>multilang</option>
<option value='nb'>nb</option>
<option value='nonedit'>nonedit</option>
<option value='po4a'>po4a</option>
<option value='scs'>scs</option>
<option value='wian'>wian</option>
</select> <input type='submit' value='switch'/></form></td></tr>
<tr><td class='sub'>old ikiwiki engine, based on git.ikiwiki.info</td><td class='sub right'>Jonas Smedegaard</td></tr></table>
<table class='tabs'><tr><td>
<a href='/ikiwiki/legacy/'>summary</a><a href='/ikiwiki/legacy/refs/?id=dba7d7b490a9347bf51f7f9bbb3869d7477cfe21'>refs</a><a href='/ikiwiki/legacy/log/openid-selector_nb'>log</a><a href='/ikiwiki/legacy/tree/openid-selector_nb?id=dba7d7b490a9347bf51f7f9bbb3869d7477cfe21'>tree</a><a href='/ikiwiki/legacy/commit/openid-selector_nb?id=dba7d7b490a9347bf51f7f9bbb3869d7477cfe21'>commit</a><a class='active' href='/ikiwiki/legacy/diff/openid-selector_nb?id=dba7d7b490a9347bf51f7f9bbb3869d7477cfe21'>diff</a></td><td class='form'><form class='right' method='get' action='/ikiwiki/legacy/log/openid-selector_nb'>
<input type='hidden' name='id' value='dba7d7b490a9347bf51f7f9bbb3869d7477cfe21'/><select name='qt'>
<option value='grep'>log msg</option>
<option value='author'>author</option>
<option value='committer'>committer</option>
<option value='range'>range</option>
</select>
<input class='txt' type='search' size='10' name='q' value=''/>
<input type='submit' value='search'/>
</form>
</td></tr></table>
<div class='path'>path: <a href='/ikiwiki/legacy/diff/?id=dba7d7b490a9347bf51f7f9bbb3869d7477cfe21'>root</a>/<a href='/ikiwiki/legacy/diff/openid-selector_nb?id=dba7d7b490a9347bf51f7f9bbb3869d7477cfe21'>openid-selector_nb</a></div><div class='content'><div class='cgit-panel'><b>diff options</b><form method='get'><input type='hidden' name='id' value='dba7d7b490a9347bf51f7f9bbb3869d7477cfe21'/><table><tr><td colspan='2'/></tr><tr><td class='label'>context:</td><td class='ctrl'><select name='context' onchange='this.form.submit();'><option value='1'>1</option><option value='2'>2</option><option value='3' selected='selected'>3</option><option value='4'>4</option><option value='5'>5</option><option value='6'>6</option><option value='7'>7</option><option value='8'>8</option><option value='9'>9</option><option value='10'>10</option><option value='15'>15</option><option value='20'>20</option><option value='25'>25</option><option value='30'>30</option><option value='35'>35</option><option value='40'>40</option></select></td></tr><tr><td class='label'>space:</td><td class='ctrl'><select name='ignorews' onchange='this.form.submit();'><option value='0' selected='selected'>include</option><option value='1'>ignore</option></select></td></tr><tr><td class='label'>mode:</td><td class='ctrl'><select name='dt' onchange='this.form.submit();'><option value='0' selected='selected'>unified</option><option value='1'>ssdiff</option><option value='2'>stat only</option></select></td></tr><tr><td/><td class='ctrl'><noscript><input type='submit' value='reload'/></noscript></td></tr></table></form></div><div class='diffstat-header'><a href='/ikiwiki/legacy/diff/?id=dba7d7b490a9347bf51f7f9bbb3869d7477cfe21'>Diffstat</a> (limited to 'openid-selector_nb')</div><table summary='diffstat' class='diffstat'></table><div class='diffstat-summary'>0 files changed, 0 insertions, 0 deletions</div><table summary='diff' class='diff'><tr><td></td></tr></table></div> <!-- class=content -->
<div class='footer'>generated by <a href='https://git.zx2c4.com/cgit/about/'>cgit v1.2.3</a> (<a href='https://git-scm.com/'>git 2.46.0</a>) at 2025-07-23 07:39:41 +0000</div>
</div> <!-- id=cgit -->
</body>
</html>
</li>
<li id="n_15" class="hl"><span class="hl slc"># GNU General Public License for more details.</span></li>
<li id="n_16" class="hl"><span class="hl slc">#</span></li>
<li id="n_17" class="hl"><span class="hl slc"># You should have received a copy of the GNU General Public License</span></li>
<li id="n_18" class="hl"><span class="hl slc"># along with this program; if not, write to the Free Software</span></li>
<li id="n_19" class="hl"><span class="hl slc"># Foundation, Inc.,</span></li>
<li id="n_20" class="hl"><span class="hl slc"># 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA</span></li>
<li id="n_21" class="hl"><span class="hl slc">#</span></li>
<li id="n_22" class="hl"><span class="hl slc">########################################################################</span></li>
<li id="n_23" class="hl"></li>
<li id="n_24" class="hl"><span class="hl com">=encoding UTF-8</span></li>
<li id="n_25" class="hl"><span class="hl com"></span></li>
<li id="n_26" class="hl"><span class="hl com">=head1 NAME</span></li>
<li id="n_27" class="hl"><span class="hl com"></span></li>
<li id="n_28" class="hl"><span class="hl com">Locale::Po4a::Text - convert text documents from/to PO files</span></li>
<li id="n_29" class="hl"><span class="hl com"></span></li>
<li id="n_30" class="hl"><span class="hl com">=head1 DESCRIPTION</span></li>
<li id="n_31" class="hl"><span class="hl com"></span></li>
<li id="n_32" class="hl"><span class="hl com">The po4a (PO for anything) project goal is to ease translations (and more</span></li>
<li id="n_33" class="hl"><span class="hl com">interestingly, the maintenance of translations) using gettext tools on</span></li>
<li id="n_34" class="hl"><span class="hl com">areas where they were not expected like documentation.</span></li>
<li id="n_35" class="hl"><span class="hl com"></span></li>
<li id="n_36" class="hl"><span class="hl com">Locale::Po4a::Text is a module to help the translation of text documents into</span></li>
<li id="n_37" class="hl"><span class="hl com">other [human] languages.</span></li>
<li id="n_38" class="hl"><span class="hl com"></span></li>
<li id="n_39" class="hl"><span class="hl com">Paragraphs are split on empty lines (or lines containing only spaces or</span></li>
<li id="n_40" class="hl"><span class="hl com">tabulations).</span></li>
<li id="n_41" class="hl"><span class="hl com"></span></li>
<li id="n_42" class="hl"><span class="hl com">If a paragraph contains a line starting by a space (or tabulation), this</span></li>
<li id="n_43" class="hl"><span class="hl com">paragraph won&#39;t be rewrapped.</span></li>
<li id="n_44" class="hl"><span class="hl com"></span></li>
<li id="n_45" class="hl"><span class="hl com">=cut</span></li>
<li id="n_46" class="hl"></li>
<li id="n_47" class="hl"><span class="hl kwa">package </span>Locale<span class="hl opt">::</span>Po4a<span class="hl opt">::</span>Text<span class="hl opt">;</span></li>
<li id="n_48" class="hl"></li>
<li id="n_49" class="hl"><span class="hl kwa">use </span><span class="hl num">5.006</span><span class="hl opt">;</span></li>
<li id="n_50" class="hl"><span class="hl kwa">use </span>strict<span class="hl opt">;</span></li>
<li id="n_51" class="hl"><span class="hl kwa">use </span>warnings<span class="hl opt">;</span></li>
<li id="n_52" class="hl"></li>
<li id="n_53" class="hl"><span class="hl kwa">require </span>Exporter<span class="hl opt">;</span></li>
<li id="n_54" class="hl"><span class="hl kwa">use </span>vars <span class="hl sng">qw(</span><span class="hl ipl">&#64;ISA </span><span class="hl sng"></span><span class="hl ipl">&#64;EXPORT</span><span class="hl sng">)</span><span class="hl opt">;</span></li>
<li id="n_55" class="hl"><span class="hl kwb">&#64;ISA </span><span class="hl opt">= </span><span class="hl sng">qw(Locale::Po4a::TransTractor)</span><span class="hl opt">;</span></li>
<li id="n_56" class="hl"><span class="hl kwb">&#64;EXPORT </span><span class="hl opt">= </span><span class="hl sng">qw()</span><span class="hl opt">;</span></li>
<li id="n_57" class="hl"></li>
<li id="n_58" class="hl"><span class="hl kwa">use </span>Locale<span class="hl opt">::</span>Po4a<span class="hl opt">::</span>TransTractor<span class="hl opt">;</span></li>
<li id="n_59" class="hl"><span class="hl kwa">use </span>Locale<span class="hl opt">::</span>Po4a<span class="hl opt">::</span>Common<span class="hl opt">;</span></li>
<li id="n_60" class="hl"></li>
<li id="n_61" class="hl"><span class="hl com">=head1 OPTIONS ACCEPTED BY THIS MODULE</span></li>
<li id="n_62" class="hl"><span class="hl com"></span></li>
<li id="n_63" class="hl"><span class="hl com">These are this module&#39;s particular options:</span></li>
<li id="n_64" class="hl"><span class="hl com"></span></li>
<li id="n_65" class="hl"><span class="hl com">=over</span></li>
<li id="n_66" class="hl"><span class="hl com"></span></li>
<li id="n_67" class="hl"><span class="hl com">=item B&lt;nobullets&gt;</span></li>
<li id="n_68" class="hl"><span class="hl com"></span></li>
<li id="n_69" class="hl"><span class="hl com">Deactivate detection of bullets.</span></li>
<li id="n_70" class="hl"><span class="hl com"></span></li>
<li id="n_71" class="hl"><span class="hl com">By default, when a bullet is detected, the bullet paragraph is not considered</span></li>
<li id="n_72" class="hl"><span class="hl com">as a verbatim paragraph (with the no-wrap flag in the PO file), but the module</span></li>
<li id="n_73" class="hl"><span class="hl com">rewrap this paragraph in the generated PO file and in the translation.</span></li>
<li id="n_74" class="hl"><span class="hl com"></span></li>
<li id="n_75" class="hl"><span class="hl com">=cut</span></li>
<li id="n_76" class="hl"></li>
<li id="n_77" class="hl"><span class="hl kwc">my </span><span class="hl kwb">$bullets </span><span class="hl opt">= </span><span class="hl num">1</span><span class="hl opt">;</span></li>
<li id="n_78" class="hl"></li>
<li id="n_79" class="hl"><span class="hl com">=item B&lt;tabs&gt;=I&lt;mode&gt;</span></li>
<li id="n_80" class="hl"><span class="hl com"></span></li>
<li id="n_81" class="hl"><span class="hl com">Specify how tabulations shall be handled. The I&lt;mode&gt; can be any of:</span></li>
<li id="n_82" class="hl"><span class="hl com"></span></li>
<li id="n_83" class="hl"><span class="hl com">=over</span></li>
<li id="n_84" class="hl"><span class="hl com"></span></li>
<li id="n_85" class="hl"><span class="hl com">=item B&lt;split&gt;</span></li>
<li id="n_86" class="hl"><span class="hl com"></span></li>
<li id="n_87" class="hl"><span class="hl com">Lines with tabulations introduce breaks in the current paragraph.</span></li>
<li id="n_88" class="hl"><span class="hl com"></span></li>
<li id="n_89" class="hl"><span class="hl com">=item B&lt;verbatim&gt;</span></li>
<li id="n_90" class="hl"><span class="hl com"></span></li>
<li id="n_91" class="hl"><span class="hl com">Paragraph containing tabulations will not be re-wrapped.</span></li>
<li id="n_92" class="hl"><span class="hl com"></span></li>
<li id="n_93" class="hl"><span class="hl com">=back</span></li>
<li id="n_94" class="hl"><span class="hl com"></span></li>
<li id="n_95" class="hl"><span class="hl com">By default, tabulations are considered as spaces.</span></li>
<li id="n_96" class="hl"><span class="hl com"></span></li>
<li id="n_97" class="hl"><span class="hl com">=cut</span></li>
<li id="n_98" class="hl"></li>
<li id="n_99" class="hl"><span class="hl kwc">my </span><span class="hl kwb">$tabs </span><span class="hl opt">= </span><span class="hl sng">&quot;&quot;</span><span class="hl opt">;</span></li>
<li id="n_100" class="hl"></li>
<li id="n_101" class="hl"><span class="hl com">=item B&lt;breaks&gt;=I&lt;regex&gt;</span></li>
<li id="n_102" class="hl"><span class="hl com"></span></li>
<li id="n_103" class="hl"><span class="hl com">A regular expression matching lines which introduce breaks.</span></li>
<li id="n_104" class="hl"><span class="hl com">The regular expression will be anchored so that the whole line must match.</span></li>
<li id="n_105" class="hl"><span class="hl com"></span></li>
<li id="n_106" class="hl"><span class="hl com">=cut</span></li>
<li id="n_107" class="hl"></li>
<li id="n_108" class="hl"><span class="hl kwc">my </span><span class="hl kwb">$breaks</span><span class="hl opt">;</span></li>
<li id="n_109" class="hl"></li>
<li id="n_110" class="hl"><span class="hl com">=item B&lt;debianchangelog&gt;</span></li>
<li id="n_111" class="hl"><span class="hl com"></span></li>
<li id="n_112" class="hl"><span class="hl com">Handle the header and footer of</span></li>
<li id="n_113" class="hl"><span class="hl com">released versions, which only contain non translatable informations.</span></li>
<li id="n_114" class="hl"><span class="hl com"></span></li>
<li id="n_115" class="hl"><span class="hl com">=cut</span></li>
<li id="n_116" class="hl"></li>
<li id="n_117" class="hl"><span class="hl kwc">my </span><span class="hl kwb">$debianchangelog </span><span class="hl opt">= </span><span class="hl num">0</span><span class="hl opt">;</span></li>
<li id="n_118" class="hl"></li>
<li id="n_119" class="hl"><span class="hl com">=item B&lt;fortunes&gt;</span></li>
<li id="n_120" class="hl"><span class="hl com"></span></li>
<li id="n_121" class="hl"><span class="hl com">Handle the fortunes format, which separate fortunes with a line which</span></li>
<li id="n_122" class="hl"><span class="hl com">consists in &#39;%&#39; or &#39;%%&#39;, and use &#39;%%&#39; as the beginning of a comment.</span></li>
<li id="n_123" class="hl"><span class="hl com"></span></li>
<li id="n_124" class="hl"><span class="hl com">=cut</span></li>
<li id="n_125" class="hl"></li>
<li id="n_126" class="hl"><span class="hl kwc">my </span><span class="hl kwb">$fortunes </span><span class="hl opt">= </span><span class="hl num">0</span><span class="hl opt">;</span></li>
<li id="n_127" class="hl"></li>
<li id="n_128" class="hl"><span class="hl com">=item B&lt;markdown&gt;</span></li>
<li id="n_129" class="hl"><span class="hl com"></span></li>
<li id="n_130" class="hl"><span class="hl com">Handle some special markup in Markdown-formatted texts.</span></li>
<li id="n_131" class="hl"><span class="hl com"></span></li>
<li id="n_132" class="hl"><span class="hl com">=cut</span></li>
<li id="n_133" class="hl"></li>
<li id="n_134" class="hl"><span class="hl kwc">my </span><span class="hl kwb">$markdown </span><span class="hl opt">= </span><span class="hl num">0</span><span class="hl opt">;</span></li>
<li id="n_135" class="hl"></li>
<li id="n_136" class="hl"><span class="hl com">=item B&lt;asciidoc&gt;</span></li>
<li id="n_137" class="hl"><span class="hl com"></span></li>
<li id="n_138" class="hl"><span class="hl com">Handle documents in the asciidoc format.</span></li>
<li id="n_139" class="hl"><span class="hl com"></span></li>
<li id="n_140" class="hl"><span class="hl com">=cut</span></li>
<li id="n_141" class="hl"></li>
<li id="n_142" class="hl"><span class="hl kwc">my </span><span class="hl kwb">$asciidoc </span><span class="hl opt">= </span><span class="hl num">0</span><span class="hl opt">;</span></li>
<li id="n_143" class="hl"></li>
<li id="n_144" class="hl"><span class="hl com">=back</span></li>
<li id="n_145" class="hl"><span class="hl com"></span></li>
<li id="n_146" class="hl"><span class="hl com">=cut</span></li>
<li id="n_147" class="hl"></li>
<li id="n_148" class="hl"><span class="hl kwa">sub </span>initialize <span class="hl opt">{</span></li>
<li id="n_149" class="hl">    <span class="hl kwc">my </span><span class="hl kwb">$self </span><span class="hl opt">= </span><span class="hl kwc">shift</span><span class="hl opt">;</span></li>
<li id="n_150" class="hl">    <span class="hl kwc">my </span><span class="hl kwb">%options </span><span class="hl opt">= </span><span class="hl kwb">&#64;_</span><span class="hl opt">;</span></li>
<li id="n_151" class="hl"></li>
<li id="n_152" class="hl">    <span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>options<span class="hl opt">}{</span><span class="hl sng">&#39;asciidoc&#39;</span><span class="hl opt">} = </span><span class="hl num">1</span><span class="hl opt">;</span></li>
<li id="n_153" class="hl">    <span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>options<span class="hl opt">}{</span><span class="hl sng">&#39;breaks&#39;</span><span class="hl opt">} = </span><span class="hl num">1</span><span class="hl opt">;</span></li>
<li id="n_154" class="hl">    <span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>options<span class="hl opt">}{</span><span class="hl sng">&#39;debianchangelog&#39;</span><span class="hl opt">} = </span><span class="hl num">1</span><span class="hl opt">;</span></li>
<li id="n_155" class="hl">    <span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>options<span class="hl opt">}{</span><span class="hl sng">&#39;debug&#39;</span><span class="hl opt">} = </span><span class="hl num">1</span><span class="hl opt">;</span></li>
<li id="n_156" class="hl">    <span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>options<span class="hl opt">}{</span><span class="hl sng">&#39;fortunes&#39;</span><span class="hl opt">} = </span><span class="hl num">1</span><span class="hl opt">;</span></li>
<li id="n_157" class="hl">    <span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>options<span class="hl opt">}{</span><span class="hl sng">&#39;markdown&#39;</span><span class="hl opt">} = </span><span class="hl num">1</span><span class="hl opt">;</span></li>
<li id="n_158" class="hl">    <span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>options<span class="hl opt">}{</span><span class="hl sng">&#39;nobullets&#39;</span><span class="hl opt">} = </span><span class="hl num">1</span><span class="hl opt">;</span></li>
<li id="n_159" class="hl">    <span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>options<span class="hl opt">}{</span><span class="hl sng">&#39;tabs&#39;</span><span class="hl opt">} = </span><span class="hl num">1</span><span class="hl opt">;</span></li>
<li id="n_160" class="hl">    <span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>options<span class="hl opt">}{</span><span class="hl sng">&#39;verbose&#39;</span><span class="hl opt">} = </span><span class="hl num">1</span><span class="hl opt">;</span></li>
<li id="n_161" class="hl"></li>
<li id="n_162" class="hl">    <span class="hl kwa">foreach </span><span class="hl kwc">my </span><span class="hl kwb">$opt </span><span class="hl opt">(</span><span class="hl kwc">keys </span><span class="hl kwb">%options</span><span class="hl opt">) {</span></li>
<li id="n_163" class="hl">        <span class="hl kwc">die </span>wrap_mod<span class="hl opt">(</span><span class="hl sng">&quot;po4a::text&quot;</span><span class="hl opt">,</span></li>
<li id="n_164" class="hl">                     dgettext<span class="hl opt">(</span><span class="hl sng">&quot;po4a&quot;</span><span class="hl opt">, </span><span class="hl sng">&quot;Unknown option: </span><span class="hl ipl">%s</span><span class="hl sng">&quot;</span><span class="hl opt">), </span><span class="hl kwb">$opt</span><span class="hl opt">)</span></li>
<li id="n_165" class="hl">            <span class="hl kwa">unless </span><span class="hl kwc">exists </span><span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>options<span class="hl opt">}{</span><span class="hl kwb">$opt</span><span class="hl opt">};</span></li>
<li id="n_166" class="hl">        <span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>options<span class="hl opt">}{</span><span class="hl kwb">$opt</span><span class="hl opt">} = </span><span class="hl kwb">$options</span><span class="hl opt">{</span><span class="hl kwb">$opt</span><span class="hl opt">};</span></li>
<li id="n_167" class="hl">    <span class="hl opt">}</span></li>
<li id="n_168" class="hl"></li>
<li id="n_169" class="hl">    <span class="hl kwa">if </span><span class="hl opt">(</span><span class="hl kwc">defined </span><span class="hl kwb">$options</span><span class="hl opt">{</span><span class="hl sng">&#39;nobullets&#39;</span><span class="hl opt">}) {</span></li>
<li id="n_170" class="hl">        <span class="hl kwb">$bullets </span><span class="hl opt">= </span><span class="hl num">0</span><span class="hl opt">;</span></li>
<li id="n_171" class="hl">    <span class="hl opt">}</span></li>
<li id="n_172" class="hl"></li>
<li id="n_173" class="hl">    <span class="hl kwa">if </span><span class="hl opt">(</span><span class="hl kwc">defined </span><span class="hl kwb">$options</span><span class="hl opt">{</span><span class="hl sng">&#39;tabs&#39;</span><span class="hl opt">}) {</span></li>
<li id="n_174" class="hl">        <span class="hl kwb">$tabs </span><span class="hl opt">= </span><span class="hl kwb">$options</span><span class="hl opt">{</span><span class="hl sng">&#39;tabs&#39;</span><span class="hl opt">};</span></li>
<li id="n_175" class="hl">    <span class="hl opt">}</span></li>
<li id="n_176" class="hl"></li>
<li id="n_177" class="hl">    <span class="hl kwa">if </span><span class="hl opt">(</span><span class="hl kwc">defined </span><span class="hl kwb">$options</span><span class="hl opt">{</span><span class="hl sng">&#39;breaks&#39;</span><span class="hl opt">}) {</span></li>
<li id="n_178" class="hl">        <span class="hl kwb">$breaks </span><span class="hl opt">= </span><span class="hl kwb">$options</span><span class="hl opt">{</span><span class="hl sng">&#39;breaks&#39;</span><span class="hl opt">};</span></li>
<li id="n_179" class="hl">    <span class="hl opt">}</span></li>
<li id="n_180" class="hl"></li>
<li id="n_181" class="hl">    <span class="hl kwa">if </span><span class="hl opt">(</span><span class="hl kwc">defined </span><span class="hl kwb">$options</span><span class="hl opt">{</span><span class="hl sng">&#39;debianchangelog&#39;</span><span class="hl opt">}) {</span></li>
<li id="n_182" class="hl">        <span class="hl kwb">$debianchangelog</span><span class="hl opt">=</span><span class="hl num">1</span><span class="hl opt">;</span></li>
<li id="n_183" class="hl">    <span class="hl opt">}</span></li>
<li id="n_184" class="hl"></li>
<li id="n_185" class="hl">    <span class="hl kwa">if </span><span class="hl opt">(</span><span class="hl kwc">defined </span><span class="hl kwb">$options</span><span class="hl opt">{</span><span class="hl sng">&#39;fortunes&#39;</span><span class="hl opt">}) {</span></li>
<li id="n_186" class="hl">        <span class="hl kwb">$fortunes</span><span class="hl opt">=</span><span class="hl num">1</span><span class="hl opt">;</span></li>
<li id="n_187" class="hl">    <span class="hl opt">}</span></li>
<li id="n_188" class="hl"></li>
<li id="n_189" class="hl">    <span class="hl kwa">if </span><span class="hl opt">(</span><span class="hl kwc">defined </span><span class="hl kwb">$options</span><span class="hl opt">{</span><span class="hl sng">&#39;markdown&#39;</span><span class="hl opt">}) {</span></li>
<li id="n_190" class="hl">        <span class="hl kwb">$markdown</span><span class="hl opt">=</span><span class="hl num">1</span><span class="hl opt">;</span></li>
<li id="n_191" class="hl">    <span class="hl opt">}</span></li>
<li id="n_192" class="hl"></li>
<li id="n_193" class="hl">    <span class="hl kwb">$asciidoc</span><span class="hl opt">=</span><span class="hl num">1 </span><span class="hl kwa">if </span><span class="hl opt">(</span><span class="hl kwc">defined </span><span class="hl kwb">$options</span><span class="hl opt">{</span><span class="hl sng">&#39;asciidoc&#39;</span><span class="hl opt">});</span></li>
<li id="n_194" class="hl"><span class="hl opt">}</span></li>
<li id="n_195" class="hl"></li>
<li id="n_196" class="hl"><span class="hl kwa">sub </span>parse <span class="hl opt">{</span></li>
<li id="n_197" class="hl">    <span class="hl kwc">my </span><span class="hl kwb">$self </span><span class="hl opt">= </span><span class="hl kwc">shift</span><span class="hl opt">;</span></li>
<li id="n_198" class="hl">    <span class="hl kwc">my </span><span class="hl opt">(</span><span class="hl kwb">$line</span><span class="hl opt">,</span><span class="hl kwb">$ref</span><span class="hl opt">);</span></li>
<li id="n_199" class="hl">    <span class="hl kwc">my </span><span class="hl kwb">$paragraph</span><span class="hl opt">=</span><span class="hl sng">&quot;&quot;</span><span class="hl opt">;</span></li>
<li id="n_200" class="hl">    <span class="hl kwc">my </span><span class="hl kwb">$wrapped_mode </span><span class="hl opt">= </span><span class="hl num">1</span><span class="hl opt">;</span></li>
<li id="n_201" class="hl">    <span class="hl kwc">my </span><span class="hl kwb">$expect_header </span><span class="hl opt">= </span><span class="hl num">1</span><span class="hl opt">;</span></li>
<li id="n_202" class="hl">    <span class="hl kwc">my </span><span class="hl kwb">$end_of_paragraph </span><span class="hl opt">= </span><span class="hl num">0</span><span class="hl opt">;</span></li>
<li id="n_203" class="hl">    <span class="hl opt">(</span><span class="hl kwb">$line</span><span class="hl opt">,</span><span class="hl kwb">$ref</span><span class="hl opt">)=</span><span class="hl kwb">$self</span><span class="hl opt">-&gt;</span><span class="hl kwd">shiftline</span><span class="hl opt">();</span></li>
<li id="n_204" class="hl">    <span class="hl kwc">my </span><span class="hl kwb">$file </span><span class="hl opt">= </span><span class="hl kwb">$ref</span><span class="hl opt">;</span></li>
<li id="n_205" class="hl">    <span class="hl kwb">$file </span><span class="hl opt">=~ </span><span class="hl kwd">s/:[0-9]+$// </span><span class="hl kwa">if </span><span class="hl kwc">defined</span><span class="hl opt">(</span><span class="hl kwb">$line</span><span class="hl opt">);</span></li>
<li id="n_206" class="hl">    <span class="hl kwa">while </span><span class="hl opt">(</span><span class="hl kwc">defined</span><span class="hl opt">(</span><span class="hl kwb">$line</span><span class="hl opt">)) {</span></li>
<li id="n_207" class="hl">        <span class="hl kwb">$ref </span><span class="hl opt">=~ </span><span class="hl kwd">m/^(.*):[0-9]+$/</span><span class="hl opt">;</span></li>
<li id="n_208" class="hl">        <span class="hl kwa">if </span><span class="hl opt">(</span><span class="hl kwb">$1 </span><span class="hl kwc">ne </span><span class="hl kwb">$file</span><span class="hl opt">) {</span></li>
<li id="n_209" class="hl">            <span class="hl kwb">$file </span><span class="hl opt">= </span><span class="hl kwb">$1</span><span class="hl opt">;</span></li>
<li id="n_210" class="hl">            do_paragraph<span class="hl opt">(</span><span class="hl kwb">$self</span><span class="hl opt">,</span><span class="hl kwb">$paragraph</span><span class="hl opt">,</span><span class="hl kwb">$wrapped_mode</span><span class="hl opt">);</span></li>
<li id="n_211" class="hl">            <span class="hl kwb">$paragraph</span><span class="hl opt">=</span><span class="hl sng">&quot;&quot;</span><span class="hl opt">;</span></li>
<li id="n_212" class="hl">            <span class="hl kwb">$wrapped_mode </span><span class="hl opt">= </span><span class="hl num">1</span><span class="hl opt">;</span></li>
<li id="n_213" class="hl">            <span class="hl kwb">$expect_header </span><span class="hl opt">= </span><span class="hl num">1</span><span class="hl opt">;</span></li>
<li id="n_214" class="hl">        <span class="hl opt">}</span></li>
<li id="n_215" class="hl"></li>
<li id="n_216" class="hl">        <span class="hl kwc">chomp</span><span class="hl opt">(</span><span class="hl kwb">$line</span><span class="hl opt">);</span></li>
<li id="n_217" class="hl">        <span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span><span class="hl kwc">ref</span><span class="hl opt">}=</span><span class="hl sng">&quot;</span><span class="hl ipl">$ref</span><span class="hl sng">&quot;</span><span class="hl opt">;</span></li>
<li id="n_218" class="hl">        <span class="hl kwa">if </span><span class="hl opt">(</span><span class="hl kwb">$debianchangelog </span><span class="hl kwc">and</span></li>
<li id="n_219" class="hl">            <span class="hl kwb">$expect_header </span><span class="hl kwc">and</span></li>
<li id="n_220" class="hl">            <span class="hl kwb">$line </span><span class="hl opt">=~ /^(</span>\w<span class="hl opt">[-+</span><span class="hl num">0</span><span class="hl opt">-</span><span class="hl num">9</span>a-z<span class="hl opt">.]*)</span>\ \<span class="hl opt">(([^</span>\<span class="hl opt">(</span>\<span class="hl opt">) </span><span class="hl esc">\t</span><span class="hl opt">]+)</span>\<span class="hl opt">) </span><span class="hl slc"># src, version</span></li>
<li id="n_221" class="hl">                       \s<span class="hl opt">+([-+</span><span class="hl num">0</span><span class="hl opt">-</span><span class="hl num">9</span>a-z<span class="hl opt">.]+);                 </span><span class="hl slc"># distribution</span></li>
<li id="n_222" class="hl">                       \s<span class="hl opt">*</span>urgency\s<span class="hl opt">*</span>\<span class="hl opt">=</span>\s<span class="hl opt">*(.*</span>\S<span class="hl opt">)</span>\s<span class="hl opt">*</span><span class="hl kwb">$/ix</span><span class="hl opt">) { </span><span class="hl slc">#</span></li>
<li id="n_223" class="hl">            do_paragraph<span class="hl opt">(</span><span class="hl kwb">$self</span><span class="hl opt">,</span><span class="hl kwb">$paragraph</span><span class="hl opt">,</span><span class="hl kwb">$wrapped_mode</span><span class="hl opt">);</span></li>
<li id="n_224" class="hl">            <span class="hl kwb">$paragraph</span><span class="hl opt">=</span><span class="hl sng">&quot;&quot;</span><span class="hl opt">;</span></li>
<li id="n_225" class="hl">            <span class="hl kwb">$self</span><span class="hl opt">-&gt;</span><span class="hl kwd">pushline</span><span class="hl opt">(</span><span class="hl sng">&quot;</span><span class="hl ipl">$line</span><span class="hl sng"></span><span class="hl esc">\n</span><span class="hl sng">&quot;</span><span class="hl opt">);</span></li>
<li id="n_226" class="hl">            <span class="hl kwb">$expect_header</span><span class="hl opt">=</span><span class="hl num">0</span><span class="hl opt">;</span></li>
<li id="n_227" class="hl">        <span class="hl opt">} </span><span class="hl kwa">elsif </span><span class="hl opt">(</span><span class="hl kwb">$debianchangelog </span><span class="hl kwc">and</span></li>
<li id="n_228" class="hl">                 <span class="hl kwb">$line </span><span class="hl opt">=~ </span><span class="hl kwd">m/^ \-\- (.*) &lt;(.*)&gt;  ((\w+\,\s*)?\d{1,2}\s+\w+\s+\d{4}\s+\d{1,2}:\d\d:\d\d\s+[-+]\d{4}(\s+\([^\\\(\)]\))?)$/</span><span class="hl opt">) {</span></li>
<li id="n_229" class="hl">            <span class="hl slc"># Found trailer</span></li>
<li id="n_230" class="hl">            do_paragraph<span class="hl opt">(</span><span class="hl kwb">$self</span><span class="hl opt">,</span><span class="hl kwb">$paragraph</span><span class="hl opt">,</span><span class="hl kwb">$wrapped_mode</span><span class="hl opt">);</span></li>
<li id="n_231" class="hl">            <span class="hl kwb">$paragraph</span><span class="hl opt">=</span><span class="hl sng">&quot;&quot;</span><span class="hl opt">;</span></li>
<li id="n_232" class="hl">            <span class="hl kwb">$self</span><span class="hl opt">-&gt;</span><span class="hl kwd">pushline</span><span class="hl opt">(</span><span class="hl sng">&quot;</span><span class="hl ipl">$line</span><span class="hl sng"></span><span class="hl esc">\n</span><span class="hl sng">&quot;</span><span class="hl opt">);</span></li>
<li id="n_233" class="hl">            <span class="hl kwb">$expect_header</span><span class="hl opt">=</span><span class="hl num">1</span><span class="hl opt">;</span></li>
<li id="n_234" class="hl">        <span class="hl opt">} </span><span class="hl kwa">elsif </span><span class="hl opt">(</span><span class="hl kwb">$fortunes </span><span class="hl kwc">and</span></li>
<li id="n_235" class="hl">                 <span class="hl kwb">$line </span><span class="hl opt">=~ </span><span class="hl kwd">m/^%%?\s*$/</span><span class="hl opt">) {</span></li>
<li id="n_236" class="hl">            <span class="hl slc"># Found end of fortune</span></li>
<li id="n_237" class="hl">            do_paragraph<span class="hl opt">(</span><span class="hl kwb">$self</span><span class="hl opt">,</span><span class="hl kwb">$paragraph</span><span class="hl opt">,</span><span class="hl kwb">$wrapped_mode</span><span class="hl opt">);</span></li>
<li id="n_238" class="hl">            <span class="hl kwb">$self</span><span class="hl opt">-&gt;</span><span class="hl kwd">pushline</span><span class="hl opt">(</span><span class="hl sng">&quot;</span><span class="hl esc">\n</span><span class="hl sng">&quot;</span><span class="hl opt">) </span><span class="hl kwa">unless </span><span class="hl opt">(   </span><span class="hl kwb">$wrapped_mode </span><span class="hl opt">== </span><span class="hl num">0</span></li>
<li id="n_239" class="hl">                                          <span class="hl kwc">or </span><span class="hl kwb">$paragraph </span><span class="hl kwc">eq </span><span class="hl sng">&quot;&quot;</span><span class="hl opt">);</span></li>
<li id="n_240" class="hl">            <span class="hl kwb">$paragraph</span><span class="hl opt">=</span><span class="hl sng">&quot;&quot;</span><span class="hl opt">;</span></li>
<li id="n_241" class="hl">            <span class="hl kwb">$wrapped_mode </span><span class="hl opt">= </span><span class="hl num">1</span><span class="hl opt">;</span></li>
<li id="n_242" class="hl">            <span class="hl kwb">$self</span><span class="hl opt">-&gt;</span><span class="hl kwd">pushline</span><span class="hl opt">(</span><span class="hl sng">&quot;</span><span class="hl ipl">$line</span><span class="hl sng"></span><span class="hl esc">\n</span><span class="hl sng">&quot;</span><span class="hl opt">);</span></li>
<li id="n_243" class="hl">        <span class="hl opt">} </span><span class="hl kwa">elsif </span><span class="hl opt">(    (</span><span class="hl kwc">defined </span><span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>verbatim<span class="hl opt">})</span></li>
<li id="n_244" class="hl">                 <span class="hl kwc">and </span><span class="hl opt">(</span><span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>verbatim<span class="hl opt">} == </span><span class="hl num">2</span><span class="hl opt">)) {</span></li>
<li id="n_245" class="hl">            <span class="hl slc"># Untranslated blocks</span></li>
<li id="n_246" class="hl">            <span class="hl kwb">$self</span><span class="hl opt">-&gt;</span><span class="hl kwd">pushline</span><span class="hl opt">(</span><span class="hl kwb">$line</span><span class="hl opt">.</span><span class="hl sng">&quot;</span><span class="hl esc">\n</span><span class="hl sng">&quot;</span><span class="hl opt">);</span></li>
<li id="n_247" class="hl">            <span class="hl kwa">if </span><span class="hl opt">(</span><span class="hl kwb">$asciidoc </span><span class="hl kwc">and</span></li>
<li id="n_248" class="hl">                <span class="hl opt">(</span><span class="hl kwb">$line </span><span class="hl opt">=~ </span><span class="hl kwd">m/^(\/</span><span class="hl opt">{</span><span class="hl num">4</span><span class="hl opt">,}|~{</span><span class="hl num">4</span><span class="hl opt">,})</span><span class="hl kwb">$/</span><span class="hl opt">)) {</span></li>
<li id="n_249" class="hl">                <span class="hl kwc">undef </span><span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>verbatim<span class="hl opt">};</span></li>
<li id="n_250" class="hl">                <span class="hl kwc">undef </span><span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>type<span class="hl opt">};</span></li>
<li id="n_251" class="hl">                <span class="hl kwb">$wrapped_mode </span><span class="hl opt">= </span><span class="hl num">1</span><span class="hl opt">;</span></li>
<li id="n_252" class="hl">            <span class="hl opt">}</span></li>
<li id="n_253" class="hl">        <span class="hl opt">} </span><span class="hl kwa">elsif </span><span class="hl opt">(   (</span><span class="hl kwb">$line </span><span class="hl opt">=~ </span><span class="hl kwd">/^\s*$/</span><span class="hl opt">)</span></li>
<li id="n_254" class="hl">                 <span class="hl kwc">or </span><span class="hl opt">(    </span><span class="hl kwc">defined </span><span class="hl kwb">$breaks</span></li>
<li id="n_255" class="hl">                     <span class="hl kwc">and </span><span class="hl kwb">$line </span><span class="hl opt">=~ </span><span class="hl kwd">m/^$breaks$/</span><span class="hl opt">)) {</span></li>
<li id="n_256" class="hl">            <span class="hl slc"># Break paragraphs on lines containing only spaces</span></li>
<li id="n_257" class="hl">            do_paragraph<span class="hl opt">(</span><span class="hl kwb">$self</span><span class="hl opt">,</span><span class="hl kwb">$paragraph</span><span class="hl opt">,</span><span class="hl kwb">$wrapped_mode</span><span class="hl opt">);</span></li>
<li id="n_258" class="hl">            <span class="hl kwb">$paragraph</span><span class="hl opt">=</span><span class="hl sng">&quot;&quot;</span><span class="hl opt">;</span></li>
<li id="n_259" class="hl">            <span class="hl kwb">$wrapped_mode </span><span class="hl opt">= </span><span class="hl num">1 </span><span class="hl kwa">unless </span><span class="hl kwc">defined</span><span class="hl opt">(</span><span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>verbatim<span class="hl opt">});</span></li>
<li id="n_260" class="hl">            <span class="hl kwb">$self</span><span class="hl opt">-&gt;</span><span class="hl kwd">pushline</span><span class="hl opt">(</span><span class="hl kwb">$line</span><span class="hl opt">.</span><span class="hl sng">&quot;</span><span class="hl esc">\n</span><span class="hl sng">&quot;</span><span class="hl opt">);</span></li>
<li id="n_261" class="hl">        <span class="hl opt">} </span><span class="hl kwa">elsif </span><span class="hl opt">(</span><span class="hl kwb">$asciidoc </span><span class="hl kwc">and </span><span class="hl opt">(</span><span class="hl kwc">not defined</span><span class="hl opt">(</span><span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>verbatim<span class="hl opt">})) </span><span class="hl kwc">and</span></li>
<li id="n_262" class="hl">                 <span class="hl opt">(</span><span class="hl kwb">$line </span><span class="hl opt">=~ </span><span class="hl kwd">m/^(\+|--)$/</span><span class="hl opt">)) {</span></li>
<li id="n_263" class="hl">            <span class="hl slc"># List Item Continuation or List Block</span></li>
<li id="n_264" class="hl">            do_paragraph<span class="hl opt">(</span><span class="hl kwb">$self</span><span class="hl opt">,</span><span class="hl kwb">$paragraph</span><span class="hl opt">,</span><span class="hl kwb">$wrapped_mode</span><span class="hl opt">);</span></li>
<li id="n_265" class="hl">            <span class="hl kwb">$paragraph</span><span class="hl opt">=</span><span class="hl sng">&quot;&quot;</span><span class="hl opt">;</span></li>
<li id="n_266" class="hl">            <span class="hl kwb">$self</span><span class="hl opt">-&gt;</span><span class="hl kwd">pushline</span><span class="hl opt">(</span><span class="hl kwb">$line</span><span class="hl opt">.</span><span class="hl sng">&quot;</span><span class="hl esc">\n</span><span class="hl sng">&quot;</span><span class="hl opt">);</span></li>
<li id="n_267" class="hl">        <span class="hl opt">} </span><span class="hl kwa">elsif </span><span class="hl opt">(</span><span class="hl kwb">$asciidoc </span><span class="hl kwc">and </span><span class="hl opt">(</span><span class="hl kwc">not defined</span><span class="hl opt">(</span><span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>verbatim<span class="hl opt">})) </span><span class="hl kwc">and</span></li>
<li id="n_268" class="hl">                 <span class="hl opt">(</span><span class="hl kwb">$line </span><span class="hl opt">=~ </span><span class="hl kwd">m/^(={4,}|-{4,}|~{4,}|\^{4,}|\+{4,})$/</span><span class="hl opt">) </span><span class="hl kwc">and</span></li>
<li id="n_269" class="hl">                 <span class="hl opt">(</span><span class="hl kwc">defined</span><span class="hl opt">(</span><span class="hl kwb">$paragraph</span><span class="hl opt">) )</span><span class="hl kwc">and</span></li>
<li id="n_270" class="hl">                 <span class="hl opt">(</span><span class="hl kwb">$paragraph </span><span class="hl opt">=~ </span><span class="hl kwd">m/^[^\n]*\n$/s</span><span class="hl opt">) </span><span class="hl kwc">and</span></li>
<li id="n_271" class="hl">                 <span class="hl opt">(</span><span class="hl kwc">length</span><span class="hl opt">(</span><span class="hl kwb">$paragraph</span><span class="hl opt">) == (</span><span class="hl kwc">length</span><span class="hl opt">(</span><span class="hl kwb">$line</span><span class="hl opt">)+</span><span class="hl num">1</span><span class="hl opt">))) {</span></li>
<li id="n_272" class="hl">            <span class="hl slc"># Found title</span></li>
<li id="n_273" class="hl">            <span class="hl kwb">$wrapped_mode </span><span class="hl opt">= </span><span class="hl num">0</span><span class="hl opt">;</span></li>
<li id="n_274" class="hl">            <span class="hl kwc">my </span><span class="hl kwb">$level </span><span class="hl opt">= </span><span class="hl kwb">$line</span><span class="hl opt">;</span></li>
<li id="n_275" class="hl">            <span class="hl kwb">$level </span><span class="hl opt">=~ </span><span class="hl kwd">s/^(.).*$/$1/</span><span class="hl opt">;</span></li>
<li id="n_276" class="hl">            <span class="hl kwc">my </span><span class="hl kwb">$t </span><span class="hl opt">= </span><span class="hl kwb">$self</span><span class="hl opt">-&gt;</span><span class="hl kwd">translate</span><span class="hl opt">(</span><span class="hl kwb">$paragraph</span><span class="hl opt">,</span></li>
<li id="n_277" class="hl">                                     <span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span><span class="hl kwc">ref</span><span class="hl opt">},</span></li>
<li id="n_278" class="hl">                                     <span class="hl sng">&quot;Title </span><span class="hl ipl">$level</span><span class="hl sng">&quot;</span><span class="hl opt">,</span></li>
<li id="n_279" class="hl">                                     <span class="hl sng">&quot;wrap&quot;</span> <span class="hl opt">=&gt; </span><span class="hl num">0</span><span class="hl opt">);</span></li>
<li id="n_280" class="hl">            <span class="hl kwb">$self</span><span class="hl opt">-&gt;</span><span class="hl kwd">pushline</span><span class="hl opt">(</span><span class="hl kwb">$t</span><span class="hl opt">);</span></li>
<li id="n_281" class="hl">            <span class="hl kwb">$paragraph</span><span class="hl opt">=</span><span class="hl sng">&quot;&quot;</span><span class="hl opt">;</span></li>
<li id="n_282" class="hl">            <span class="hl kwb">$wrapped_mode </span><span class="hl opt">= </span><span class="hl num">1</span><span class="hl opt">;</span></li>
<li id="n_283" class="hl">            <span class="hl kwb">$self</span><span class="hl opt">-&gt;</span><span class="hl kwd">pushline</span><span class="hl opt">((</span><span class="hl kwb">$level </span>x <span class="hl opt">(</span><span class="hl kwc">length</span><span class="hl opt">(</span><span class="hl kwb">$t</span><span class="hl opt">)-</span><span class="hl num">1</span><span class="hl opt">)).</span><span class="hl sng">&quot;</span><span class="hl esc">\n</span><span class="hl sng">&quot;</span><span class="hl opt">);</span></li>
<li id="n_284" class="hl">        <span class="hl opt">} </span><span class="hl kwa">elsif </span><span class="hl opt">(</span><span class="hl kwb">$asciidoc </span><span class="hl kwc">and</span></li>
<li id="n_285" class="hl">                 <span class="hl opt">(</span><span class="hl kwb">$line </span><span class="hl opt">=~ </span><span class="hl kwd">m/^(={1,5})( +)(.*?)( +\1)?$/</span><span class="hl opt">)) {</span></li>
<li id="n_286" class="hl">            <span class="hl kwc">my </span><span class="hl kwb">$titlelevel1 </span><span class="hl opt">= </span><span class="hl kwb">$1</span><span class="hl opt">;</span></li>
<li id="n_287" class="hl">            <span class="hl kwc">my </span><span class="hl kwb">$titlespaces </span><span class="hl opt">= </span><span class="hl kwb">$2</span><span class="hl opt">;</span></li>
<li id="n_288" class="hl">            <span class="hl kwc">my </span><span class="hl kwb">$title </span><span class="hl opt">= </span><span class="hl kwb">$3</span><span class="hl opt">;</span></li>
<li id="n_289" class="hl">            <span class="hl kwc">my </span><span class="hl kwb">$titlelevel2 </span><span class="hl opt">= </span><span class="hl kwb">$4</span><span class="hl opt">||</span><span class="hl sng">&quot;&quot;</span><span class="hl opt">;</span></li>
<li id="n_290" class="hl">            <span class="hl slc"># Found one line title</span></li>
<li id="n_291" class="hl">            do_paragraph<span class="hl opt">(</span><span class="hl kwb">$self</span><span class="hl opt">,</span><span class="hl kwb">$paragraph</span><span class="hl opt">,</span><span class="hl kwb">$wrapped_mode</span><span class="hl opt">);</span></li>
<li id="n_292" class="hl">            <span class="hl kwb">$wrapped_mode </span><span class="hl opt">= </span><span class="hl num">0</span><span class="hl opt">;</span></li>
<li id="n_293" class="hl">            <span class="hl kwb">$paragraph</span><span class="hl opt">=</span><span class="hl sng">&quot;&quot;</span><span class="hl opt">;</span></li>
<li id="n_294" class="hl">            <span class="hl kwc">my </span><span class="hl kwb">$t </span><span class="hl opt">= </span><span class="hl kwb">$self</span><span class="hl opt">-&gt;</span><span class="hl kwd">translate</span><span class="hl opt">(</span><span class="hl kwb">$title</span><span class="hl opt">,</span></li>
<li id="n_295" class="hl">                                     <span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span><span class="hl kwc">ref</span><span class="hl opt">},</span></li>
<li id="n_296" class="hl">                                     <span class="hl sng">&quot;Title </span><span class="hl ipl">$titlelevel1</span><span class="hl sng">&quot;</span><span class="hl opt">,</span></li>
<li id="n_297" class="hl">                                     <span class="hl sng">&quot;wrap&quot;</span> <span class="hl opt">=&gt; </span><span class="hl num">0</span><span class="hl opt">);</span></li>
<li id="n_298" class="hl">            <span class="hl kwb">$self</span><span class="hl opt">-&gt;</span><span class="hl kwd">pushline</span><span class="hl opt">(</span><span class="hl kwb">$titlelevel1</span><span class="hl opt">.</span><span class="hl kwb">$titlespaces</span><span class="hl opt">.</span><span class="hl kwb">$t</span><span class="hl opt">.</span><span class="hl kwb">$titlelevel2</span><span class="hl opt">.</span><span class="hl sng">&quot;</span><span class="hl esc">\n</span><span class="hl sng">&quot;</span><span class="hl opt">);</span></li>
<li id="n_299" class="hl">            <span class="hl kwb">$wrapped_mode </span><span class="hl opt">= </span><span class="hl num">1</span><span class="hl opt">;</span></li>
<li id="n_300" class="hl">        <span class="hl opt">} </span><span class="hl kwa">elsif </span><span class="hl opt">(</span><span class="hl kwb">$asciidoc </span><span class="hl kwc">and</span></li>
<li id="n_301" class="hl">                 <span class="hl opt">(</span><span class="hl kwb">$line </span><span class="hl opt">=~ </span><span class="hl kwd">m/^(\/</span><span class="hl opt">{</span><span class="hl num">4</span><span class="hl opt">,}|</span>\<span class="hl opt">+{</span><span class="hl num">4</span><span class="hl opt">,}|-{</span><span class="hl num">4</span><span class="hl opt">,}|</span>\<span class="hl opt">.{</span><span class="hl num">4</span><span class="hl opt">,}|</span>\<span class="hl opt">*{</span><span class="hl num">4</span><span class="hl opt">,}|</span>_<span class="hl opt">{</span><span class="hl num">4</span><span class="hl opt">,}|={</span><span class="hl num">4</span><span class="hl opt">,}|~{</span><span class="hl num">4</span><span class="hl opt">,})</span><span class="hl kwb">$/</span><span class="hl opt">)) {</span></li>
<li id="n_302" class="hl">            <span class="hl slc"># Found one delimited block</span></li>
<li id="n_303" class="hl">            <span class="hl kwc">my </span><span class="hl kwb">$t </span><span class="hl opt">= </span><span class="hl kwb">$line</span><span class="hl opt">;</span></li>
<li id="n_304" class="hl">            <span class="hl kwb">$t </span><span class="hl opt">=~ </span><span class="hl kwd">s/^(.).*$/$1/</span><span class="hl opt">;</span></li>
<li id="n_305" class="hl">            <span class="hl kwc">my </span><span class="hl kwb">$type </span><span class="hl opt">= </span><span class="hl sng">&quot;delimited block </span><span class="hl ipl">$t</span><span class="hl sng">&quot;</span><span class="hl opt">;</span></li>
<li id="n_306" class="hl">            <span class="hl kwa">if </span><span class="hl opt">(</span><span class="hl kwc">defined </span><span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>verbatim<span class="hl opt">} </span><span class="hl kwc">and </span><span class="hl opt">(</span><span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>type<span class="hl opt">} </span><span class="hl kwc">ne </span><span class="hl kwb">$type</span><span class="hl opt">)) {</span></li>
<li id="n_307" class="hl">                <span class="hl kwb">$paragraph </span><span class="hl opt">.= </span><span class="hl sng">&quot;</span><span class="hl ipl">$line</span><span class="hl sng"></span><span class="hl esc">\n</span><span class="hl sng">&quot;</span><span class="hl opt">;</span></li>
<li id="n_308" class="hl">            <span class="hl opt">} </span><span class="hl kwa">else </span><span class="hl opt">{</span></li>
<li id="n_309" class="hl">            do_paragraph<span class="hl opt">(</span><span class="hl kwb">$self</span><span class="hl opt">,</span><span class="hl kwb">$paragraph</span><span class="hl opt">,</span><span class="hl kwb">$wrapped_mode</span><span class="hl opt">);</span></li>
<li id="n_310" class="hl">            <span class="hl kwa">if </span><span class="hl opt">(    (</span><span class="hl kwc">defined </span><span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>type<span class="hl opt">})</span></li>
<li id="n_311" class="hl">                <span class="hl kwc">and </span><span class="hl opt">(</span><span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>type<span class="hl opt">} </span><span class="hl kwc">eq </span><span class="hl kwb">$type</span><span class="hl opt">)) {</span></li>
<li id="n_312" class="hl">                <span class="hl kwc">undef </span><span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>type<span class="hl opt">};</span></li>
<li id="n_313" class="hl">                <span class="hl kwc">undef </span><span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>verbatim<span class="hl opt">};</span></li>
<li id="n_314" class="hl">                <span class="hl kwb">$wrapped_mode </span><span class="hl opt">= </span><span class="hl num">1</span><span class="hl opt">;</span></li>
<li id="n_315" class="hl">            <span class="hl opt">} </span><span class="hl kwa">else </span><span class="hl opt">{</span></li>
<li id="n_316" class="hl">                <span class="hl kwa">if </span><span class="hl opt">(</span><span class="hl kwb">$t </span><span class="hl kwc">eq </span><span class="hl sng">&quot;\/&quot;</span><span class="hl opt">) {</span></li>
<li id="n_317" class="hl">                    <span class="hl slc"># CommentBlock, should not be treated</span></li>
<li id="n_318" class="hl">                    <span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>verbatim<span class="hl opt">} = </span><span class="hl num">2</span><span class="hl opt">;</span></li>
<li id="n_319" class="hl">                <span class="hl opt">} </span><span class="hl kwa">elsif </span><span class="hl opt">(</span><span class="hl kwb">$t </span><span class="hl kwc">eq </span><span class="hl sng">&quot;+&quot;</span><span class="hl opt">) {</span></li>
<li id="n_320" class="hl">                    <span class="hl slc"># PassthroughBlock</span></li>
<li id="n_321" class="hl">                    <span class="hl kwb">$wrapped_mode </span><span class="hl opt">= </span><span class="hl num">0</span><span class="hl opt">;</span></li>
<li id="n_322" class="hl">                    <span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>verbatim<span class="hl opt">} = </span><span class="hl num">1</span><span class="hl opt">;</span></li>
<li id="n_323" class="hl">                <span class="hl opt">} </span><span class="hl kwa">elsif </span><span class="hl opt">(</span><span class="hl kwb">$t </span><span class="hl kwc">eq </span><span class="hl sng">&quot;-&quot;</span><span class="hl opt">) {</span></li>
<li id="n_324" class="hl">                    <span class="hl slc"># ListingBlock</span></li>
<li id="n_325" class="hl">                    <span class="hl kwb">$wrapped_mode </span><span class="hl opt">= </span><span class="hl num">0</span><span class="hl opt">;</span></li>
<li id="n_326" class="hl">                    <span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>verbatim<span class="hl opt">} = </span><span class="hl num">1</span><span class="hl opt">;</span></li>
<li id="n_327" class="hl">                <span class="hl opt">} </span><span class="hl kwa">elsif </span><span class="hl opt">(</span><span class="hl kwb">$t </span><span class="hl kwc">eq </span><span class="hl sng">&quot;.&quot;</span><span class="hl opt">) {</span></li>
<li id="n_328" class="hl">                    <span class="hl slc"># LiteralBlock</span></li>
<li id="n_329" class="hl">                    <span class="hl kwb">$wrapped_mode </span><span class="hl opt">= </span><span class="hl num">0</span><span class="hl opt">;</span></li>
<li id="n_330" class="hl">                    <span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>verbatim<span class="hl opt">} = </span><span class="hl num">1</span><span class="hl opt">;</span></li>
<li id="n_331" class="hl">                <span class="hl opt">} </span><span class="hl kwa">elsif </span><span class="hl opt">(</span><span class="hl kwb">$t </span><span class="hl kwc">eq </span><span class="hl sng">&quot;*&quot;</span><span class="hl opt">) {</span></li>
<li id="n_332" class="hl">                    <span class="hl slc"># SidebarBlock</span></li>
<li id="n_333" class="hl">                    <span class="hl kwb">$wrapped_mode </span><span class="hl opt">= </span><span class="hl num">1</span><span class="hl opt">;</span></li>
<li id="n_334" class="hl">                <span class="hl opt">} </span><span class="hl kwa">elsif </span><span class="hl opt">(</span><span class="hl kwb">$t </span><span class="hl kwc">eq </span><span class="hl sng">&quot;_&quot;</span><span class="hl opt">) {</span></li>
<li id="n_335" class="hl">                    <span class="hl slc"># QuoteBlock</span></li>
<li id="n_336" class="hl">                    <span class="hl kwa">if </span><span class="hl opt">(    (</span><span class="hl kwc">defined </span><span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>type<span class="hl opt">})</span></li>
<li id="n_337" class="hl">                        <span class="hl kwc">and </span><span class="hl opt">(</span><span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>type<span class="hl opt">} </span><span class="hl kwc">eq </span><span class="hl sng">&quot;verse&quot;</span><span class="hl opt">)) {</span></li>
<li id="n_338" class="hl">                        <span class="hl kwb">$wrapped_mode </span><span class="hl opt">= </span><span class="hl num">0</span><span class="hl opt">;</span></li>
<li id="n_339" class="hl">                        <span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>verbatim<span class="hl opt">} = </span><span class="hl num">1</span><span class="hl opt">;</span></li>
<li id="n_340" class="hl">                    <span class="hl opt">} </span><span class="hl kwa">else </span><span class="hl opt">{</span></li>
<li id="n_341" class="hl">                        <span class="hl kwb">$wrapped_mode </span><span class="hl opt">= </span><span class="hl num">1</span><span class="hl opt">;</span></li>
<li id="n_342" class="hl">                    <span class="hl opt">}</span></li>
<li id="n_343" class="hl">                <span class="hl opt">} </span><span class="hl kwa">elsif </span><span class="hl opt">(</span><span class="hl kwb">$t </span><span class="hl kwc">eq </span><span class="hl sng">&quot;=&quot;</span><span class="hl opt">) {</span></li>
<li id="n_344" class="hl">                    <span class="hl slc"># ExampleBlock</span></li>
<li id="n_345" class="hl">                    <span class="hl kwb">$wrapped_mode </span><span class="hl opt">= </span><span class="hl num">1</span><span class="hl opt">;</span></li>
<li id="n_346" class="hl">                <span class="hl opt">} </span><span class="hl kwa">elsif </span><span class="hl opt">(</span><span class="hl kwb">$t </span><span class="hl kwc">eq </span><span class="hl sng">&quot;~&quot;</span><span class="hl opt">) {</span></li>
<li id="n_347" class="hl">                    <span class="hl slc"># Filter blocks, TBC: not translated</span></li>
<li id="n_348" class="hl">                    <span class="hl kwb">$wrapped_mode </span><span class="hl opt">= </span><span class="hl num">0</span><span class="hl opt">;</span></li>
<li id="n_349" class="hl">                    <span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>verbatim<span class="hl opt">} = </span><span class="hl num">2</span><span class="hl opt">;</span></li>
<li id="n_350" class="hl">                <span class="hl opt">} </span></li>
<li id="n_351" class="hl">                <span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>type<span class="hl opt">} = </span><span class="hl kwb">$type</span><span class="hl opt">;</span></li>
<li id="n_352" class="hl">            <span class="hl opt">}</span></li>
<li id="n_353" class="hl">            <span class="hl kwb">$paragraph</span><span class="hl opt">=</span><span class="hl sng">&quot;&quot;</span><span class="hl opt">;</span></li>
<li id="n_354" class="hl">            <span class="hl kwb">$self</span><span class="hl opt">-&gt;</span><span class="hl kwd">pushline</span><span class="hl opt">(</span><span class="hl kwb">$line</span><span class="hl opt">.</span><span class="hl sng">&quot;</span><span class="hl esc">\n</span><span class="hl sng">&quot;</span><span class="hl opt">);</span></li>
<li id="n_355" class="hl">            <span class="hl opt">}</span></li>
<li id="n_356" class="hl">        <span class="hl opt">} </span><span class="hl kwa">elsif </span><span class="hl opt">(</span><span class="hl kwb">$asciidoc </span><span class="hl kwc">and not defined </span><span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>verbatim<span class="hl opt">} </span><span class="hl kwc">and</span></li>
<li id="n_357" class="hl">                 <span class="hl opt">(</span><span class="hl kwb">$line </span><span class="hl opt">=~ </span><span class="hl kwd">m/^\[\[([^\]]*)\]\]$/</span><span class="hl opt">)) {</span></li>
<li id="n_358" class="hl">            <span class="hl slc"># Found BlockId</span></li>
<li id="n_359" class="hl">            do_paragraph<span class="hl opt">(</span><span class="hl kwb">$self</span><span class="hl opt">,</span><span class="hl kwb">$paragraph</span><span class="hl opt">,</span><span class="hl kwb">$wrapped_mode</span><span class="hl opt">);</span></li>
<li id="n_360" class="hl">            <span class="hl kwb">$paragraph</span><span class="hl opt">=</span><span class="hl sng">&quot;&quot;</span><span class="hl opt">;</span></li>
<li id="n_361" class="hl">            <span class="hl kwb">$wrapped_mode </span><span class="hl opt">= </span><span class="hl num">1</span><span class="hl opt">;</span></li>
<li id="n_362" class="hl">            <span class="hl kwb">$self</span><span class="hl opt">-&gt;</span><span class="hl kwd">pushline</span><span class="hl opt">(</span><span class="hl kwb">$line</span><span class="hl opt">.</span><span class="hl sng">&quot;</span><span class="hl esc">\n</span><span class="hl sng">&quot;</span><span class="hl opt">);</span></li>
<li id="n_363" class="hl">            <span class="hl kwc">undef </span><span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>bullet<span class="hl opt">};</span></li>
<li id="n_364" class="hl">            <span class="hl kwc">undef </span><span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>indent<span class="hl opt">};</span></li>
<li id="n_365" class="hl">        <span class="hl opt">} </span><span class="hl kwa">elsif </span><span class="hl opt">(</span><span class="hl kwb">$asciidoc </span><span class="hl kwc">and not defined </span><span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>verbatim<span class="hl opt">} </span><span class="hl kwc">and</span></li>
<li id="n_366" class="hl">                 <span class="hl opt">(</span><span class="hl kwb">$paragraph </span><span class="hl kwc">eq </span><span class="hl sng">&quot;&quot;</span><span class="hl opt">) </span><span class="hl kwc">and</span></li>
<li id="n_367" class="hl">                 <span class="hl opt">(</span><span class="hl kwb">$line </span><span class="hl opt">=~ </span><span class="hl kwd">m/^((?:NOTE|TIP|IMPORTANT|WARNING|CAUTION):\s+)(.*)$/</span><span class="hl opt">)) {</span></li>
<li id="n_368" class="hl">            <span class="hl kwc">my </span><span class="hl kwb">$type </span><span class="hl opt">= </span><span class="hl kwb">$1</span><span class="hl opt">;</span></li>
<li id="n_369" class="hl">            <span class="hl kwc">my </span><span class="hl kwb">$text </span><span class="hl opt">= </span><span class="hl kwb">$2</span><span class="hl opt">;</span></li>
<li id="n_370" class="hl">            do_paragraph<span class="hl opt">(</span><span class="hl kwb">$self</span><span class="hl opt">,</span><span class="hl kwb">$paragraph</span><span class="hl opt">,</span><span class="hl kwb">$wrapped_mode</span><span class="hl opt">);</span></li>
<li id="n_371" class="hl">            <span class="hl kwb">$paragraph</span><span class="hl opt">=</span><span class="hl kwb">$text</span><span class="hl opt">.</span><span class="hl sng">&quot;</span><span class="hl esc">\n</span><span class="hl sng">&quot;</span><span class="hl opt">;</span></li>
<li id="n_372" class="hl">            <span class="hl kwb">$wrapped_mode </span><span class="hl opt">= </span><span class="hl num">1</span><span class="hl opt">;</span></li>
<li id="n_373" class="hl">            <span class="hl kwb">$self</span><span class="hl opt">-&gt;</span><span class="hl kwd">pushline</span><span class="hl opt">(</span><span class="hl kwb">$type</span><span class="hl opt">);</span></li>
<li id="n_374" class="hl">            <span class="hl kwc">undef </span><span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>bullet<span class="hl opt">};</span></li>
<li id="n_375" class="hl">            <span class="hl kwc">undef </span><span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>indent<span class="hl opt">};</span></li>
<li id="n_376" class="hl">        <span class="hl opt">} </span><span class="hl kwa">elsif </span><span class="hl opt">(</span><span class="hl kwb">$asciidoc </span><span class="hl kwc">and not defined </span><span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>verbatim<span class="hl opt">} </span><span class="hl kwc">and</span></li>
<li id="n_377" class="hl">                 <span class="hl opt">(</span><span class="hl kwb">$line </span><span class="hl opt">=~ </span><span class="hl kwd">m/^\[(NOTE|TIP|IMPORTANT|WARNING|CAUTION|verse|quote)\]$/</span><span class="hl opt">)) {</span></li>
<li id="n_378" class="hl">            <span class="hl kwc">my </span><span class="hl kwb">$type </span><span class="hl opt">= </span><span class="hl kwb">$1</span><span class="hl opt">;</span></li>
<li id="n_379" class="hl">            do_paragraph<span class="hl opt">(</span><span class="hl kwb">$self</span><span class="hl opt">,</span><span class="hl kwb">$paragraph</span><span class="hl opt">,</span><span class="hl kwb">$wrapped_mode</span><span class="hl opt">);</span></li>
<li id="n_380" class="hl">            <span class="hl kwb">$paragraph</span><span class="hl opt">=</span><span class="hl sng">&quot;&quot;</span><span class="hl opt">;</span></li>
<li id="n_381" class="hl">            <span class="hl kwb">$wrapped_mode </span><span class="hl opt">= </span><span class="hl num">1</span><span class="hl opt">;</span></li>
<li id="n_382" class="hl">            <span class="hl kwb">$self</span><span class="hl opt">-&gt;</span><span class="hl kwd">pushline</span><span class="hl opt">(</span><span class="hl kwb">$line</span><span class="hl opt">.</span><span class="hl sng">&quot;</span><span class="hl esc">\n</span><span class="hl sng">&quot;</span><span class="hl opt">);</span></li>
<li id="n_383" class="hl">            <span class="hl kwa">if </span><span class="hl opt">(</span><span class="hl kwb">$type  </span><span class="hl kwc">eq </span><span class="hl sng">&quot;verse&quot;</span><span class="hl opt">) {</span></li>
<li id="n_384" class="hl">                <span class="hl kwb">$wrapped_mode </span><span class="hl opt">= </span><span class="hl num">0</span><span class="hl opt">;</span></li>
<li id="n_385" class="hl">            <span class="hl opt">}</span></li>
<li id="n_386" class="hl">            <span class="hl kwc">undef </span><span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>bullet<span class="hl opt">};</span></li>
<li id="n_387" class="hl">            <span class="hl kwc">undef </span><span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>indent<span class="hl opt">};</span></li>
<li id="n_388" class="hl">        <span class="hl opt">} </span><span class="hl kwa">elsif </span><span class="hl opt">(</span><span class="hl kwb">$asciidoc </span><span class="hl kwc">and not defined </span><span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>verbatim<span class="hl opt">} </span><span class="hl kwc">and</span></li>
<li id="n_389" class="hl">                 <span class="hl opt">(</span><span class="hl kwb">$line </span><span class="hl opt">=~ </span><span class="hl kwd">m/^\[(verse|quote), +(.*)\]$/</span><span class="hl opt">)) {</span></li>
<li id="n_390" class="hl">            <span class="hl kwc">my </span><span class="hl kwb">$type </span><span class="hl opt">= </span><span class="hl kwb">$1</span><span class="hl opt">;</span></li>
<li id="n_391" class="hl">            <span class="hl kwc">my </span><span class="hl kwb">$arg </span><span class="hl opt">= </span><span class="hl kwb">$2</span><span class="hl opt">;</span></li>
<li id="n_392" class="hl">            do_paragraph<span class="hl opt">(</span><span class="hl kwb">$self</span><span class="hl opt">,</span><span class="hl kwb">$paragraph</span><span class="hl opt">,</span><span class="hl kwb">$wrapped_mode</span><span class="hl opt">);</span></li>
<li id="n_393" class="hl">            <span class="hl kwb">$paragraph</span><span class="hl opt">=</span><span class="hl sng">&quot;&quot;</span><span class="hl opt">;</span></li>
<li id="n_394" class="hl">            <span class="hl kwc">my </span><span class="hl kwb">$t </span><span class="hl opt">= </span><span class="hl kwb">$self</span><span class="hl opt">-&gt;</span><span class="hl kwd">translate</span><span class="hl opt">(</span><span class="hl kwb">$arg</span><span class="hl opt">,</span></li>
<li id="n_395" class="hl">                                     <span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span><span class="hl kwc">ref</span><span class="hl opt">},</span></li>
<li id="n_396" class="hl">                                     <span class="hl sng">&quot;</span><span class="hl ipl">$type</span><span class="hl sng">&quot;</span><span class="hl opt">,</span></li>
<li id="n_397" class="hl">                                     <span class="hl sng">&quot;wrap&quot;</span> <span class="hl opt">=&gt; </span><span class="hl num">0</span><span class="hl opt">);</span></li>
<li id="n_398" class="hl">            <span class="hl kwb">$self</span><span class="hl opt">-&gt;</span><span class="hl kwd">pushline</span><span class="hl opt">(</span><span class="hl sng">&quot;[</span><span class="hl ipl">$type</span><span class="hl sng">, </span><span class="hl ipl">$t</span><span class="hl sng">]</span><span class="hl esc">\n</span><span class="hl sng">&quot;</span><span class="hl opt">);</span></li>
<li id="n_399" class="hl">            <span class="hl kwb">$wrapped_mode </span><span class="hl opt">= </span><span class="hl num">1</span><span class="hl opt">;</span></li>
<li id="n_400" class="hl">            <span class="hl kwa">if </span><span class="hl opt">(</span><span class="hl kwb">$type  </span><span class="hl kwc">eq </span><span class="hl sng">&quot;verse&quot;</span><span class="hl opt">) {</span></li>
<li id="n_401" class="hl">                <span class="hl kwb">$wrapped_mode </span><span class="hl opt">= </span><span class="hl num">0</span><span class="hl opt">;</span></li>
<li id="n_402" class="hl">            <span class="hl opt">}</span></li>
<li id="n_403" class="hl">            <span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>type<span class="hl opt">} = </span><span class="hl kwb">$type</span><span class="hl opt">;</span></li>
<li id="n_404" class="hl">            <span class="hl kwc">undef </span><span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>bullet<span class="hl opt">};</span></li>
<li id="n_405" class="hl">            <span class="hl kwc">undef </span><span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>indent<span class="hl opt">};</span></li>
<li id="n_406" class="hl">        <span class="hl opt">} </span><span class="hl kwa">elsif </span><span class="hl opt">(</span><span class="hl kwb">$asciidoc </span><span class="hl kwc">and not defined </span><span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>verbatim<span class="hl opt">} </span><span class="hl kwc">and</span></li>
<li id="n_407" class="hl">                 <span class="hl opt">(</span><span class="hl kwb">$line </span><span class="hl opt">=~ </span><span class="hl kwd">m/^\[icon=&quot;(.*)&quot;\]$/</span><span class="hl opt">)) {</span></li>
<li id="n_408" class="hl">            <span class="hl kwc">my </span><span class="hl kwb">$arg </span><span class="hl opt">= </span><span class="hl kwb">$1</span><span class="hl opt">;</span></li>
<li id="n_409" class="hl">            do_paragraph<span class="hl opt">(</span><span class="hl kwb">$self</span><span class="hl opt">,</span><span class="hl kwb">$paragraph</span><span class="hl opt">,</span><span class="hl kwb">$wrapped_mode</span><span class="hl opt">);</span></li>
<li id="n_410" class="hl">            <span class="hl kwb">$paragraph</span><span class="hl opt">=</span><span class="hl sng">&quot;&quot;</span><span class="hl opt">;</span></li>
<li id="n_411" class="hl">            <span class="hl kwc">my </span><span class="hl kwb">$t </span><span class="hl opt">= </span><span class="hl kwb">$self</span><span class="hl opt">-&gt;</span><span class="hl kwd">translate</span><span class="hl opt">(</span><span class="hl kwb">$arg</span><span class="hl opt">,</span></li>
<li id="n_412" class="hl">                                     <span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span><span class="hl kwc">ref</span><span class="hl opt">},</span></li>
<li id="n_413" class="hl">                                     <span class="hl sng">&quot;icon&quot;</span><span class="hl opt">,</span></li>
<li id="n_414" class="hl">                                     <span class="hl sng">&quot;wrap&quot;</span> <span class="hl opt">=&gt; </span><span class="hl num">0</span><span class="hl opt">);</span></li>
<li id="n_415" class="hl">            <span class="hl kwb">$self</span><span class="hl opt">-&gt;</span><span class="hl kwd">pushline</span><span class="hl opt">(</span><span class="hl sng">&quot;[icon=</span><span class="hl esc">\&quot;</span><span class="hl sng"></span><span class="hl ipl">$t</span><span class="hl sng"></span><span class="hl esc">\&quot;</span><span class="hl sng">]</span><span class="hl esc">\n</span><span class="hl sng">&quot;</span><span class="hl opt">);</span></li>
<li id="n_416" class="hl">            <span class="hl kwb">$wrapped_mode </span><span class="hl opt">= </span><span class="hl num">1</span><span class="hl opt">;</span></li>
<li id="n_417" class="hl">            <span class="hl kwc">undef </span><span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>bullet<span class="hl opt">};</span></li>
<li id="n_418" class="hl">            <span class="hl kwc">undef </span><span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>indent<span class="hl opt">};</span></li>
<li id="n_419" class="hl">        <span class="hl opt">} </span><span class="hl kwa">elsif </span><span class="hl opt">(</span><span class="hl kwb">$asciidoc </span><span class="hl kwc">and not defined </span><span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>verbatim<span class="hl opt">} </span><span class="hl kwc">and</span></li>
<li id="n_420" class="hl">                 <span class="hl opt">(</span><span class="hl kwb">$line </span><span class="hl opt">=~ </span><span class="hl kwd">m/^\[icons=None, +caption=&quot;(.*)&quot;\]$/</span><span class="hl opt">)) {</span></li>
<li id="n_421" class="hl">            <span class="hl kwc">my </span><span class="hl kwb">$arg </span><span class="hl opt">= </span><span class="hl kwb">$1</span><span class="hl opt">;</span></li>
<li id="n_422" class="hl">            do_paragraph<span class="hl opt">(</span><span class="hl kwb">$self</span><span class="hl opt">,</span><span class="hl kwb">$paragraph</span><span class="hl opt">,</span><span class="hl kwb">$wrapped_mode</span><span class="hl opt">);</span></li>
<li id="n_423" class="hl">            <span class="hl kwb">$paragraph</span><span class="hl opt">=</span><span class="hl sng">&quot;&quot;</span><span class="hl opt">;</span></li>
<li id="n_424" class="hl">            <span class="hl kwc">my </span><span class="hl kwb">$t </span><span class="hl opt">= </span><span class="hl kwb">$self</span><span class="hl opt">-&gt;</span><span class="hl kwd">translate</span><span class="hl opt">(</span><span class="hl kwb">$arg</span><span class="hl opt">,</span></li>
<li id="n_425" class="hl">                                     <span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span><span class="hl kwc">ref</span><span class="hl opt">},</span></li>
<li id="n_426" class="hl">                                     <span class="hl sng">&quot;caption&quot;</span><span class="hl opt">,</span></li>
<li id="n_427" class="hl">                                     <span class="hl sng">&quot;wrap&quot;</span> <span class="hl opt">=&gt; </span><span class="hl num">0</span><span class="hl opt">);</span></li>
<li id="n_428" class="hl">            <span class="hl kwb">$self</span><span class="hl opt">-&gt;</span><span class="hl kwd">pushline</span><span class="hl opt">(</span><span class="hl sng">&quot;[icons=None, caption=</span><span class="hl esc">\&quot;</span><span class="hl sng"></span><span class="hl ipl">$t</span><span class="hl sng"></span><span class="hl esc">\&quot;</span><span class="hl sng">]</span><span class="hl esc">\n</span><span class="hl sng">&quot;</span><span class="hl opt">);</span></li>
<li id="n_429" class="hl">            <span class="hl kwb">$wrapped_mode </span><span class="hl opt">= </span><span class="hl num">1</span><span class="hl opt">;</span></li>
<li id="n_430" class="hl">            <span class="hl kwc">undef </span><span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>bullet<span class="hl opt">};</span></li>
<li id="n_431" class="hl">            <span class="hl kwc">undef </span><span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>indent<span class="hl opt">};</span></li>
<li id="n_432" class="hl">        <span class="hl opt">} </span><span class="hl kwa">elsif </span><span class="hl opt">(</span><span class="hl kwb">$asciidoc </span><span class="hl kwc">and not defined </span><span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>verbatim<span class="hl opt">} </span><span class="hl kwc">and</span></li>
<li id="n_433" class="hl">                 <span class="hl opt">(</span><span class="hl kwb">$line </span><span class="hl opt">=~ </span><span class="hl kwd">m/^(\s*)([*_+`&#39;#[:alnum:]].*)((?:::|;;|\?\?|:-)(?: *\\)?)$/</span><span class="hl opt">)) {</span></li>
<li id="n_434" class="hl">            <span class="hl kwc">my </span><span class="hl kwb">$indent </span><span class="hl opt">= </span><span class="hl kwb">$1</span><span class="hl opt">;</span></li>
<li id="n_435" class="hl">            <span class="hl kwc">my </span><span class="hl kwb">$label </span><span class="hl opt">= </span><span class="hl kwb">$2</span><span class="hl opt">;</span></li>
<li id="n_436" class="hl">            <span class="hl kwc">my </span><span class="hl kwb">$labelend </span><span class="hl opt">= </span><span class="hl kwb">$3</span><span class="hl opt">;</span></li>
<li id="n_437" class="hl">            <span class="hl slc"># Found labeled list</span></li>
<li id="n_438" class="hl">            do_paragraph<span class="hl opt">(</span><span class="hl kwb">$self</span><span class="hl opt">,</span><span class="hl kwb">$paragraph</span><span class="hl opt">,</span><span class="hl kwb">$wrapped_mode</span><span class="hl opt">);</span></li>
<li id="n_439" class="hl">            <span class="hl kwb">$paragraph</span><span class="hl opt">=</span><span class="hl sng">&quot;&quot;</span><span class="hl opt">;</span></li>
<li id="n_440" class="hl">            <span class="hl kwb">$wrapped_mode </span><span class="hl opt">= </span><span class="hl num">1</span><span class="hl opt">;</span></li>
<li id="n_441" class="hl">            <span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>bullet<span class="hl opt">} = </span><span class="hl sng">&quot;&quot;</span><span class="hl opt">;</span></li>
<li id="n_442" class="hl">            <span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>indent<span class="hl opt">} = </span><span class="hl kwb">$indent</span><span class="hl opt">;</span></li>
<li id="n_443" class="hl">            <span class="hl kwc">my </span><span class="hl kwb">$t </span><span class="hl opt">= </span><span class="hl kwb">$self</span><span class="hl opt">-&gt;</span><span class="hl kwd">translate</span><span class="hl opt">(</span><span class="hl kwb">$label</span><span class="hl opt">,</span></li>
<li id="n_444" class="hl">                                     <span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span><span class="hl kwc">ref</span><span class="hl opt">},</span></li>
<li id="n_445" class="hl">                                     <span class="hl sng">&quot;Labeled list&quot;</span><span class="hl opt">,</span></li>
<li id="n_446" class="hl">                                     <span class="hl sng">&quot;wrap&quot;</span> <span class="hl opt">=&gt; </span><span class="hl num">0</span><span class="hl opt">);</span></li>
<li id="n_447" class="hl">            <span class="hl kwb">$self</span><span class="hl opt">-&gt;</span><span class="hl kwd">pushline</span><span class="hl opt">(</span><span class="hl sng">&quot;</span><span class="hl ipl">$indent$t$labelend</span><span class="hl sng"></span><span class="hl esc">\n</span><span class="hl sng">&quot;</span><span class="hl opt">);</span></li>
<li id="n_448" class="hl">        <span class="hl opt">} </span><span class="hl kwa">elsif </span><span class="hl opt">(</span><span class="hl kwb">$asciidoc </span><span class="hl kwc">and not defined </span><span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>verbatim<span class="hl opt">} </span><span class="hl kwc">and</span></li>
<li id="n_449" class="hl">                 <span class="hl opt">(</span><span class="hl kwb">$line </span><span class="hl opt">=~ </span><span class="hl kwd">m/^(\s*)(\S.*)((?:::|;;)\s+)(.*)$/</span><span class="hl opt">)) {</span></li>
<li id="n_450" class="hl">            <span class="hl kwc">my </span><span class="hl kwb">$indent </span><span class="hl opt">= </span><span class="hl kwb">$1</span><span class="hl opt">;</span></li>
<li id="n_451" class="hl">            <span class="hl kwc">my </span><span class="hl kwb">$label </span><span class="hl opt">= </span><span class="hl kwb">$2</span><span class="hl opt">;</span></li>
<li id="n_452" class="hl">            <span class="hl kwc">my </span><span class="hl kwb">$labelend </span><span class="hl opt">= </span><span class="hl kwb">$3</span><span class="hl opt">;</span></li>
<li id="n_453" class="hl">            <span class="hl kwc">my </span><span class="hl kwb">$labeltext </span><span class="hl opt">= </span><span class="hl kwb">$4</span><span class="hl opt">;</span></li>
<li id="n_454" class="hl">            <span class="hl slc"># Found Horizontal Labeled Lists</span></li>
<li id="n_455" class="hl">            do_paragraph<span class="hl opt">(</span><span class="hl kwb">$self</span><span class="hl opt">,</span><span class="hl kwb">$paragraph</span><span class="hl opt">,</span><span class="hl kwb">$wrapped_mode</span><span class="hl opt">);</span></li>
<li id="n_456" class="hl">            <span class="hl kwb">$paragraph</span><span class="hl opt">=</span><span class="hl kwb">$labeltext</span><span class="hl opt">.</span><span class="hl sng">&quot;</span><span class="hl esc">\n</span><span class="hl sng">&quot;</span><span class="hl opt">;</span></li>
<li id="n_457" class="hl">            <span class="hl kwb">$wrapped_mode </span><span class="hl opt">= </span><span class="hl num">1</span><span class="hl opt">;</span></li>
<li id="n_458" class="hl">            <span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>bullet<span class="hl opt">} = </span><span class="hl sng">&quot;&quot;</span><span class="hl opt">;</span></li>
<li id="n_459" class="hl">            <span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>indent<span class="hl opt">} = </span><span class="hl kwb">$indent</span><span class="hl opt">;</span></li>
<li id="n_460" class="hl">            <span class="hl kwc">my </span><span class="hl kwb">$t </span><span class="hl opt">= </span><span class="hl kwb">$self</span><span class="hl opt">-&gt;</span><span class="hl kwd">translate</span><span class="hl opt">(</span><span class="hl kwb">$label</span><span class="hl opt">,</span></li>
<li id="n_461" class="hl">                                     <span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span><span class="hl kwc">ref</span><span class="hl opt">},</span></li>
<li id="n_462" class="hl">                                     <span class="hl sng">&quot;Labeled list&quot;</span><span class="hl opt">,</span></li>
<li id="n_463" class="hl">                                     <span class="hl sng">&quot;wrap&quot;</span> <span class="hl opt">=&gt; </span><span class="hl num">0</span><span class="hl opt">);</span></li>
<li id="n_464" class="hl">            <span class="hl kwb">$self</span><span class="hl opt">-&gt;</span><span class="hl kwd">pushline</span><span class="hl opt">(</span><span class="hl sng">&quot;</span><span class="hl ipl">$indent$t$labelend</span><span class="hl sng">&quot;</span><span class="hl opt">);</span></li>
<li id="n_465" class="hl">        <span class="hl opt">} </span><span class="hl kwa">elsif </span><span class="hl opt">(</span><span class="hl kwb">$asciidoc </span><span class="hl kwc">and not defined </span><span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>verbatim<span class="hl opt">} </span><span class="hl kwc">and</span></li>
<li id="n_466" class="hl">                 <span class="hl opt">(</span><span class="hl kwb">$line </span><span class="hl opt">=~ </span><span class="hl kwd">m/^\:(\S.*?)(:\s*)(.*)$/</span><span class="hl opt">)) {</span></li>
<li id="n_467" class="hl">            <span class="hl kwc">my </span><span class="hl kwb">$attrname </span><span class="hl opt">= </span><span class="hl kwb">$1</span><span class="hl opt">;</span></li>
<li id="n_468" class="hl">            <span class="hl kwc">my </span><span class="hl kwb">$attrsep </span><span class="hl opt">= </span><span class="hl kwb">$2</span><span class="hl opt">;</span></li>
<li id="n_469" class="hl">            <span class="hl kwc">my </span><span class="hl kwb">$attrvalue </span><span class="hl opt">= </span><span class="hl kwb">$3</span><span class="hl opt">;</span></li>
<li id="n_470" class="hl">            <span class="hl slc"># Found a Attribute entry</span></li>
<li id="n_471" class="hl">            do_paragraph<span class="hl opt">(</span><span class="hl kwb">$self</span><span class="hl opt">,</span><span class="hl kwb">$paragraph</span><span class="hl opt">,</span><span class="hl kwb">$wrapped_mode</span><span class="hl opt">);</span></li>
<li id="n_472" class="hl">            <span class="hl kwb">$paragraph</span><span class="hl opt">=</span><span class="hl sng">&quot;&quot;</span><span class="hl opt">;</span></li>
<li id="n_473" class="hl">            <span class="hl kwb">$wrapped_mode </span><span class="hl opt">= </span><span class="hl num">1</span><span class="hl opt">;</span></li>
<li id="n_474" class="hl">            <span class="hl kwc">undef </span><span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>bullet<span class="hl opt">};</span></li>
<li id="n_475" class="hl">            <span class="hl kwc">undef </span><span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>indent<span class="hl opt">};</span></li>
<li id="n_476" class="hl">            <span class="hl kwc">my </span><span class="hl kwb">$t </span><span class="hl opt">= </span><span class="hl kwb">$self</span><span class="hl opt">-&gt;</span><span class="hl kwd">translate</span><span class="hl opt">(</span><span class="hl kwb">$attrvalue</span><span class="hl opt">,</span></li>
<li id="n_477" class="hl">                                     <span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span><span class="hl kwc">ref</span><span class="hl opt">},</span></li>
<li id="n_478" class="hl">                                     <span class="hl sng">&quot;Attribute :</span><span class="hl ipl">$attrname</span><span class="hl sng">:&quot;</span><span class="hl opt">,</span></li>
<li id="n_479" class="hl">                                     <span class="hl sng">&quot;wrap&quot;</span> <span class="hl opt">=&gt; </span><span class="hl num">0</span><span class="hl opt">);</span></li>
<li id="n_480" class="hl">            <span class="hl kwb">$self</span><span class="hl opt">-&gt;</span><span class="hl kwd">pushline</span><span class="hl opt">(</span><span class="hl sng">&quot;:</span><span class="hl ipl">$attrname$attrsep$t</span><span class="hl sng"></span><span class="hl esc">\n</span><span class="hl sng">&quot;</span><span class="hl opt">);</span></li>
<li id="n_481" class="hl">        <span class="hl opt">} </span><span class="hl kwa">elsif </span><span class="hl opt">(</span><span class="hl kwb">$asciidoc </span><span class="hl kwc">and not defined </span><span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>verbatim<span class="hl opt">} </span><span class="hl kwc">and</span></li>
<li id="n_482" class="hl">                 <span class="hl opt">(</span><span class="hl kwb">$line </span><span class="hl opt">!~ </span><span class="hl kwd">m/^\.\./</span><span class="hl opt">) </span><span class="hl kwc">and </span><span class="hl opt">(</span><span class="hl kwb">$line </span><span class="hl opt">=~ </span><span class="hl kwd">m/^\.(\S.*)$/</span><span class="hl opt">)) {</span></li>
<li id="n_483" class="hl">            <span class="hl kwc">my </span><span class="hl kwb">$title </span><span class="hl opt">= </span><span class="hl kwb">$1</span><span class="hl opt">;</span></li>
<li id="n_484" class="hl">            <span class="hl slc"># Found block title</span></li>
<li id="n_485" class="hl">            do_paragraph<span class="hl opt">(</span><span class="hl kwb">$self</span><span class="hl opt">,</span><span class="hl kwb">$paragraph</span><span class="hl opt">,</span><span class="hl kwb">$wrapped_mode</span><span class="hl opt">);</span></li>
<li id="n_486" class="hl">            <span class="hl kwb">$paragraph</span><span class="hl opt">=</span><span class="hl sng">&quot;&quot;</span><span class="hl opt">;</span></li>
<li id="n_487" class="hl">            <span class="hl kwb">$wrapped_mode </span><span class="hl opt">= </span><span class="hl num">1</span><span class="hl opt">;</span></li>
<li id="n_488" class="hl">            <span class="hl kwc">undef </span><span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>bullet<span class="hl opt">};</span></li>
<li id="n_489" class="hl">            <span class="hl kwc">undef </span><span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>indent<span class="hl opt">};</span></li>
<li id="n_490" class="hl">            <span class="hl kwc">my </span><span class="hl kwb">$t </span><span class="hl opt">= </span><span class="hl kwb">$self</span><span class="hl opt">-&gt;</span><span class="hl kwd">translate</span><span class="hl opt">(</span><span class="hl kwb">$title</span><span class="hl opt">,</span></li>
<li id="n_491" class="hl">                                     <span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span><span class="hl kwc">ref</span><span class="hl opt">},</span></li>
<li id="n_492" class="hl">                                     <span class="hl sng">&quot;Block title&quot;</span><span class="hl opt">,</span></li>
<li id="n_493" class="hl">                                     <span class="hl sng">&quot;wrap&quot;</span> <span class="hl opt">=&gt; </span><span class="hl num">0</span><span class="hl opt">);</span></li>
<li id="n_494" class="hl">            <span class="hl kwb">$self</span><span class="hl opt">-&gt;</span><span class="hl kwd">pushline</span><span class="hl opt">(</span><span class="hl sng">&quot;.</span><span class="hl ipl">$t</span><span class="hl sng"></span><span class="hl esc">\n</span><span class="hl sng">&quot;</span><span class="hl opt">);</span></li>
<li id="n_495" class="hl">        <span class="hl opt">} </span><span class="hl kwa">elsif </span><span class="hl opt">(</span><span class="hl kwb">$asciidoc </span><span class="hl kwc">and not defined </span><span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>verbatim<span class="hl opt">} </span><span class="hl kwc">and</span></li>
<li id="n_496" class="hl">                 <span class="hl opt">(</span><span class="hl kwb">$line </span><span class="hl opt">=~ </span><span class="hl kwd">m/^(\s*)((?:[-*o+]|(?:[0-9]+[.\)])|(?:[a-z][.\)])|\([0-9]+\)|\.|\.\.)\s+)(.*)$/</span><span class="hl opt">)) {</span></li>
<li id="n_497" class="hl">            <span class="hl kwc">my </span><span class="hl kwb">$indent </span><span class="hl opt">= </span><span class="hl kwb">$1</span><span class="hl opt">||</span><span class="hl sng">&quot;&quot;</span><span class="hl opt">;</span></li>
<li id="n_498" class="hl">            <span class="hl kwc">my </span><span class="hl kwb">$bullet </span><span class="hl opt">= </span><span class="hl kwb">$2</span><span class="hl opt">;</span></li>
<li id="n_499" class="hl">            <span class="hl kwc">my </span><span class="hl kwb">$text </span><span class="hl opt">= </span><span class="hl kwb">$3</span><span class="hl opt">;</span></li>
<li id="n_500" class="hl">            do_paragraph<span class="hl opt">(</span><span class="hl kwb">$self</span><span class="hl opt">,</span><span class="hl kwb">$paragraph</span><span class="hl opt">,</span><span class="hl kwb">$wrapped_mode</span><span class="hl opt">);</span></li>
<li id="n_501" class="hl">            <span class="hl kwb">$paragraph </span><span class="hl opt">= </span><span class="hl kwb">$text</span><span class="hl opt">.</span><span class="hl sng">&quot;</span><span class="hl esc">\n</span><span class="hl sng">&quot;</span><span class="hl opt">;</span></li>
<li id="n_502" class="hl">            <span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>indent<span class="hl opt">} = </span><span class="hl kwb">$indent</span><span class="hl opt">;</span></li>
<li id="n_503" class="hl">            <span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>bullet<span class="hl opt">} = </span><span class="hl kwb">$bullet</span><span class="hl opt">;</span></li>
<li id="n_504" class="hl">        <span class="hl opt">} </span><span class="hl kwa">elsif </span><span class="hl opt">(</span><span class="hl kwb">$asciidoc </span><span class="hl kwc">and not defined </span><span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>verbatim<span class="hl opt">} </span><span class="hl kwc">and</span></li>
<li id="n_505" class="hl">                 <span class="hl opt">(</span><span class="hl kwb">$line </span><span class="hl opt">=~ </span><span class="hl kwd">m/^((?:&lt;?[0-9]+)?&gt; +)(.*)$/</span><span class="hl opt">)) {</span></li>
<li id="n_506" class="hl">            <span class="hl kwc">my </span><span class="hl kwb">$bullet </span><span class="hl opt">= </span><span class="hl kwb">$1</span><span class="hl opt">;</span></li>
<li id="n_507" class="hl">            <span class="hl kwc">my </span><span class="hl kwb">$text </span><span class="hl opt">= </span><span class="hl kwb">$2</span><span class="hl opt">;</span></li>
<li id="n_508" class="hl">            do_paragraph<span class="hl opt">(</span><span class="hl kwb">$self</span><span class="hl opt">,</span><span class="hl kwb">$paragraph</span><span class="hl opt">,</span><span class="hl kwb">$wrapped_mode</span><span class="hl opt">);</span></li>
<li id="n_509" class="hl">            <span class="hl kwb">$paragraph </span><span class="hl opt">= </span><span class="hl kwb">$text</span><span class="hl opt">.</span><span class="hl sng">&quot;</span><span class="hl esc">\n</span><span class="hl sng">&quot;</span><span class="hl opt">;</span></li>
<li id="n_510" class="hl">            <span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>indent<span class="hl opt">} = </span><span class="hl sng">&quot;&quot;</span><span class="hl opt">;</span></li>
<li id="n_511" class="hl">            <span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>bullet<span class="hl opt">} = </span><span class="hl kwb">$bullet</span><span class="hl opt">;</span></li>
<li id="n_512" class="hl">        <span class="hl opt">} </span><span class="hl kwa">elsif </span><span class="hl opt">(</span><span class="hl kwb">$asciidoc </span><span class="hl kwc">and not defined </span><span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>verbatim<span class="hl opt">} </span><span class="hl kwc">and</span></li>
<li id="n_513" class="hl">                 <span class="hl opt">(</span><span class="hl kwc">defined </span><span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>bullet<span class="hl opt">} </span><span class="hl kwc">and </span><span class="hl kwb">$line </span><span class="hl opt">=~ </span><span class="hl kwd">m/^(\s+)(.*)$/</span><span class="hl opt">)) {</span></li>
<li id="n_514" class="hl">            <span class="hl kwc">my </span><span class="hl kwb">$indent </span><span class="hl opt">= </span><span class="hl kwb">$1</span><span class="hl opt">;</span></li>
<li id="n_515" class="hl">            <span class="hl kwc">my </span><span class="hl kwb">$text </span><span class="hl opt">= </span><span class="hl kwb">$2</span><span class="hl opt">;</span></li>
<li id="n_516" class="hl">            <span class="hl kwa">if </span><span class="hl opt">(</span><span class="hl kwc">not defined </span><span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>indent<span class="hl opt">}) {</span></li>
<li id="n_517" class="hl">                <span class="hl kwb">$paragraph </span><span class="hl opt">.= </span><span class="hl kwb">$text</span><span class="hl opt">.</span><span class="hl sng">&quot;</span><span class="hl esc">\n</span><span class="hl sng">&quot;</span><span class="hl opt">;</span></li>
<li id="n_518" class="hl">                <span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>indent<span class="hl opt">} = </span><span class="hl kwb">$indent</span><span class="hl opt">;</span></li>
<li id="n_519" class="hl">            <span class="hl opt">} </span><span class="hl kwa">elsif </span><span class="hl opt">(</span><span class="hl kwc">length</span><span class="hl opt">(</span><span class="hl kwb">$paragraph</span><span class="hl opt">) </span><span class="hl kwc">and </span><span class="hl opt">(</span><span class="hl kwc">length</span><span class="hl opt">(</span><span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>bullet<span class="hl opt">}) + </span><span class="hl kwc">length</span><span class="hl opt">(</span><span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>indent<span class="hl opt">}) == </span><span class="hl kwc">length</span><span class="hl opt">(</span><span class="hl kwb">$indent</span><span class="hl opt">))) {</span></li>
<li id="n_520" class="hl">                <span class="hl kwb">$paragraph </span><span class="hl opt">.= </span><span class="hl kwb">$text</span><span class="hl opt">.</span><span class="hl sng">&quot;</span><span class="hl esc">\n</span><span class="hl sng">&quot;</span><span class="hl opt">;</span></li>
<li id="n_521" class="hl">            <span class="hl opt">} </span><span class="hl kwa">else </span><span class="hl opt">{</span></li>
<li id="n_522" class="hl"></li>
<li id="n_523" class="hl">                do_paragraph<span class="hl opt">(</span><span class="hl kwb">$self</span><span class="hl opt">,</span><span class="hl kwb">$paragraph</span><span class="hl opt">,</span><span class="hl kwb">$wrapped_mode</span><span class="hl opt">);</span></li>
<li id="n_524" class="hl">                <span class="hl kwb">$paragraph </span><span class="hl opt">= </span><span class="hl kwb">$text</span><span class="hl opt">.</span><span class="hl sng">&quot;</span><span class="hl esc">\n</span><span class="hl sng">&quot;</span><span class="hl opt">;</span></li>
<li id="n_525" class="hl">                <span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>indent<span class="hl opt">} = </span><span class="hl kwb">$indent</span><span class="hl opt">;</span></li>
<li id="n_526" class="hl">                <span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>bullet<span class="hl opt">} = </span><span class="hl sng">&quot;&quot;</span><span class="hl opt">;</span></li>
<li id="n_527" class="hl">            <span class="hl opt">}</span></li>
<li id="n_528" class="hl">        <span class="hl opt">} </span><span class="hl kwa">elsif </span><span class="hl opt">(</span><span class="hl kwb">$markdown </span><span class="hl kwc">and</span></li>
<li id="n_529" class="hl">                 <span class="hl opt">(</span><span class="hl kwc">not defined</span><span class="hl opt">(</span><span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>verbatim<span class="hl opt">})) </span><span class="hl kwc">and</span></li>
<li id="n_530" class="hl">                 <span class="hl opt">(</span><span class="hl kwb">$line </span><span class="hl opt">=~ </span><span class="hl kwd">m/^(={4,}|-{4,})$/</span><span class="hl opt">) </span><span class="hl kwc">and</span></li>
<li id="n_531" class="hl">                 <span class="hl opt">(</span><span class="hl kwc">defined</span><span class="hl opt">(</span><span class="hl kwb">$paragraph</span><span class="hl opt">) )</span><span class="hl kwc">and</span></li>
<li id="n_532" class="hl">                 <span class="hl opt">(</span><span class="hl kwb">$paragraph </span><span class="hl opt">=~ </span><span class="hl kwd">m/^[^\n]*\n$/s</span><span class="hl opt">) </span><span class="hl kwc">and</span></li>
<li id="n_533" class="hl">                 <span class="hl opt">(</span><span class="hl kwc">length</span><span class="hl opt">(</span><span class="hl kwb">$paragraph</span><span class="hl opt">) == (</span><span class="hl kwc">length</span><span class="hl opt">(</span><span class="hl kwb">$line</span><span class="hl opt">)+</span><span class="hl num">1</span><span class="hl opt">))) {</span></li>
<li id="n_534" class="hl">            <span class="hl slc"># XXX: There can be any number of underlining according</span></li>
<li id="n_535" class="hl">            <span class="hl slc">#      to the documentation. This detection, which avoid</span></li>
<li id="n_536" class="hl">            <span class="hl slc">#      translating the formatting, is only supported if</span></li>
<li id="n_537" class="hl">            <span class="hl slc">#      the underlining has the same size as the herder text.</span></li>
<li id="n_538" class="hl">            <span class="hl slc"># Found title</span></li>
<li id="n_539" class="hl">            <span class="hl kwb">$wrapped_mode </span><span class="hl opt">= </span><span class="hl num">0</span><span class="hl opt">;</span></li>
<li id="n_540" class="hl">            <span class="hl kwc">my </span><span class="hl kwb">$level </span><span class="hl opt">= </span><span class="hl kwb">$line</span><span class="hl opt">;</span></li>
<li id="n_541" class="hl">            <span class="hl kwb">$level </span><span class="hl opt">=~ </span><span class="hl kwd">s/^(.).*$/$1/</span><span class="hl opt">;</span></li>
<li id="n_542" class="hl">            <span class="hl kwc">my </span><span class="hl kwb">$t </span><span class="hl opt">= </span><span class="hl kwb">$self</span><span class="hl opt">-&gt;</span><span class="hl kwd">translate</span><span class="hl opt">(</span><span class="hl kwb">$paragraph</span><span class="hl opt">,</span></li>
<li id="n_543" class="hl">                                     <span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span><span class="hl kwc">ref</span><span class="hl opt">},</span></li>
<li id="n_544" class="hl">                                     <span class="hl sng">&quot;Title </span><span class="hl ipl">$level</span><span class="hl sng">&quot;</span><span class="hl opt">,</span></li>
<li id="n_545" class="hl">                                     <span class="hl sng">&quot;wrap&quot;</span> <span class="hl opt">=&gt; </span><span class="hl num">0</span><span class="hl opt">);</span></li>
<li id="n_546" class="hl">            <span class="hl kwb">$self</span><span class="hl opt">-&gt;</span><span class="hl kwd">pushline</span><span class="hl opt">(</span><span class="hl kwb">$t</span><span class="hl opt">);</span></li>
<li id="n_547" class="hl">            <span class="hl kwb">$paragraph</span><span class="hl opt">=</span><span class="hl sng">&quot;&quot;</span><span class="hl opt">;</span></li>
<li id="n_548" class="hl">            <span class="hl kwb">$wrapped_mode </span><span class="hl opt">= </span><span class="hl num">1</span><span class="hl opt">;</span></li>
<li id="n_549" class="hl">            <span class="hl kwb">$self</span><span class="hl opt">-&gt;</span><span class="hl kwd">pushline</span><span class="hl opt">((</span><span class="hl kwb">$level </span>x <span class="hl opt">(</span><span class="hl kwc">length</span><span class="hl opt">(</span><span class="hl kwb">$t</span><span class="hl opt">)-</span><span class="hl num">1</span><span class="hl opt">)).</span><span class="hl sng">&quot;</span><span class="hl esc">\n</span><span class="hl sng">&quot;</span><span class="hl opt">);</span></li>
<li id="n_550" class="hl">        <span class="hl opt">} </span><span class="hl kwa">elsif </span><span class="hl opt">(</span><span class="hl kwb">$markdown </span><span class="hl kwc">and</span></li>
<li id="n_551" class="hl">                 <span class="hl opt">(</span><span class="hl kwb">$line </span><span class="hl opt">=~ </span><span class="hl kwd">m/^(#{1,6})( +)(.*?)( +\1)?$/</span><span class="hl opt">)) {</span></li>
<li id="n_552" class="hl">            <span class="hl kwc">my </span><span class="hl kwb">$titlelevel1 </span><span class="hl opt">= </span><span class="hl kwb">$1</span><span class="hl opt">;</span></li>
<li id="n_553" class="hl">            <span class="hl kwc">my </span><span class="hl kwb">$titlespaces </span><span class="hl opt">= </span><span class="hl kwb">$2</span><span class="hl opt">;</span></li>
<li id="n_554" class="hl">            <span class="hl kwc">my </span><span class="hl kwb">$title </span><span class="hl opt">= </span><span class="hl kwb">$3</span><span class="hl opt">;</span></li>
<li id="n_555" class="hl">            <span class="hl kwc">my </span><span class="hl kwb">$titlelevel2 </span><span class="hl opt">= </span><span class="hl kwb">$4</span><span class="hl opt">||</span><span class="hl sng">&quot;&quot;</span><span class="hl opt">;</span></li>
<li id="n_556" class="hl">            <span class="hl slc"># Found one line title</span></li>
<li id="n_557" class="hl">            do_paragraph<span class="hl opt">(</span><span class="hl kwb">$self</span><span class="hl opt">,</span><span class="hl kwb">$paragraph</span><span class="hl opt">,</span><span class="hl kwb">$wrapped_mode</span><span class="hl opt">);</span></li>
<li id="n_558" class="hl">            <span class="hl kwb">$wrapped_mode </span><span class="hl opt">= </span><span class="hl num">0</span><span class="hl opt">;</span></li>
<li id="n_559" class="hl">            <span class="hl kwb">$paragraph</span><span class="hl opt">=</span><span class="hl sng">&quot;&quot;</span><span class="hl opt">;</span></li>
<li id="n_560" class="hl">            <span class="hl kwc">my </span><span class="hl kwb">$t </span><span class="hl opt">= </span><span class="hl kwb">$self</span><span class="hl opt">-&gt;</span><span class="hl kwd">translate</span><span class="hl opt">(</span><span class="hl kwb">$title</span><span class="hl opt">,</span></li>
<li id="n_561" class="hl">                                     <span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span><span class="hl kwc">ref</span><span class="hl opt">},</span></li>
<li id="n_562" class="hl">                                     <span class="hl sng">&quot;Title </span><span class="hl ipl">$titlelevel1</span><span class="hl sng">&quot;</span><span class="hl opt">,</span></li>
<li id="n_563" class="hl">                                     <span class="hl sng">&quot;wrap&quot;</span> <span class="hl opt">=&gt; </span><span class="hl num">0</span><span class="hl opt">);</span></li>
<li id="n_564" class="hl">            <span class="hl kwb">$self</span><span class="hl opt">-&gt;</span><span class="hl kwd">pushline</span><span class="hl opt">(</span><span class="hl kwb">$titlelevel1</span><span class="hl opt">.</span><span class="hl kwb">$titlespaces</span><span class="hl opt">.</span><span class="hl kwb">$t</span><span class="hl opt">.</span><span class="hl kwb">$titlelevel2</span><span class="hl opt">.</span><span class="hl sng">&quot;</span><span class="hl esc">\n</span><span class="hl sng">&quot;</span><span class="hl opt">);</span></li>
<li id="n_565" class="hl">            <span class="hl kwb">$wrapped_mode </span><span class="hl opt">= </span><span class="hl num">1</span><span class="hl opt">;</span></li>
<li id="n_566" class="hl">        <span class="hl opt">} </span><span class="hl kwa">elsif </span><span class="hl opt">(</span><span class="hl kwb">$markdown </span><span class="hl kwc">and</span></li>
<li id="n_567" class="hl">                 <span class="hl opt">(</span><span class="hl kwb">$paragraph </span><span class="hl kwc">eq </span><span class="hl sng">&quot;&quot;</span><span class="hl opt">) </span><span class="hl kwc">and</span></li>
<li id="n_568" class="hl">                 <span class="hl opt">(</span><span class="hl kwb">$line </span><span class="hl opt">=~ </span><span class="hl kwd">/^((\*\s*){3,}|(-\s*){3,}|(_\s*){3,})$/</span><span class="hl opt">)) {</span></li>
<li id="n_569" class="hl">            <span class="hl slc"># Horizontal rule</span></li>
<li id="n_570" class="hl">            <span class="hl kwb">$wrapped_mode </span><span class="hl opt">= </span><span class="hl num">1</span><span class="hl opt">;</span></li>
<li id="n_571" class="hl">            <span class="hl kwb">$self</span><span class="hl opt">-&gt;</span><span class="hl kwd">pushline</span><span class="hl opt">(</span><span class="hl kwb">$line</span><span class="hl opt">.</span><span class="hl sng">&quot;</span><span class="hl esc">\n</span><span class="hl sng">&quot;</span><span class="hl opt">);</span></li>
<li id="n_572" class="hl">        <span class="hl opt">} </span><span class="hl kwa">elsif </span><span class="hl opt">(</span><span class="hl kwb">$line </span><span class="hl opt">=~ </span><span class="hl kwd">/^-- $/</span><span class="hl opt">) {</span></li>
<li id="n_573" class="hl">            <span class="hl slc"># Break paragraphs on email signature hint</span></li>
<li id="n_574" class="hl">            do_paragraph<span class="hl opt">(</span><span class="hl kwb">$self</span><span class="hl opt">,</span><span class="hl kwb">$paragraph</span><span class="hl opt">,</span><span class="hl kwb">$wrapped_mode</span><span class="hl opt">);</span></li>
<li id="n_575" class="hl">            <span class="hl kwb">$paragraph</span><span class="hl opt">=</span><span class="hl sng">&quot;&quot;</span><span class="hl opt">;</span></li>
<li id="n_576" class="hl">            <span class="hl kwb">$wrapped_mode </span><span class="hl opt">= </span><span class="hl num">1</span><span class="hl opt">;</span></li>
<li id="n_577" class="hl">            <span class="hl kwb">$self</span><span class="hl opt">-&gt;</span><span class="hl kwd">pushline</span><span class="hl opt">(</span><span class="hl kwb">$line</span><span class="hl opt">.</span><span class="hl sng">&quot;</span><span class="hl esc">\n</span><span class="hl sng">&quot;</span><span class="hl opt">);</span></li>
<li id="n_578" class="hl">        <span class="hl opt">} </span><span class="hl kwa">elsif </span><span class="hl opt">(   </span><span class="hl kwb">$line </span><span class="hl opt">=~ </span><span class="hl kwd">/^=+$/</span></li>
<li id="n_579" class="hl">                 <span class="hl kwc">or </span><span class="hl kwb">$line </span><span class="hl opt">=~ </span><span class="hl kwd">/^_+$/</span></li>
<li id="n_580" class="hl">                 <span class="hl kwc">or </span><span class="hl kwb">$line </span><span class="hl opt">=~ </span><span class="hl kwd">/^-+$/</span><span class="hl opt">) {</span></li>
<li id="n_581" class="hl">            <span class="hl kwb">$wrapped_mode </span><span class="hl opt">= </span><span class="hl num">0</span><span class="hl opt">;</span></li>
<li id="n_582" class="hl">            <span class="hl kwb">$paragraph </span><span class="hl opt">.= </span><span class="hl kwb">$line</span><span class="hl opt">.</span><span class="hl sng">&quot;</span><span class="hl esc">\n</span><span class="hl sng">&quot;</span><span class="hl opt">;</span></li>
<li id="n_583" class="hl">            do_paragraph<span class="hl opt">(</span><span class="hl kwb">$self</span><span class="hl opt">,</span><span class="hl kwb">$paragraph</span><span class="hl opt">,</span><span class="hl kwb">$wrapped_mode</span><span class="hl opt">);</span></li>
<li id="n_584" class="hl">            <span class="hl kwb">$paragraph</span><span class="hl opt">=</span><span class="hl sng">&quot;&quot;</span><span class="hl opt">;</span></li>
<li id="n_585" class="hl">            <span class="hl kwb">$wrapped_mode </span><span class="hl opt">= </span><span class="hl num">1</span><span class="hl opt">;</span></li>
<li id="n_586" class="hl">        <span class="hl opt">} </span><span class="hl kwa">elsif </span><span class="hl opt">(</span><span class="hl kwb">$markdown </span><span class="hl kwc">and</span></li>
<li id="n_587" class="hl">                 <span class="hl opt">(   </span><span class="hl kwb">$line </span><span class="hl opt">=~ </span><span class="hl kwd">/^\s*\[\[\!\S+\s*$/     </span><span class="hl slc"># macro begin</span></li>
<li id="n_588" class="hl">                 <span class="hl kwc">or </span><span class="hl kwb">$line </span><span class="hl opt">=~ </span><span class="hl kwd">/^\s*&quot;&quot;&quot;\s*\]\]\s*$/</span><span class="hl opt">)) { </span><span class="hl slc"># &quot;&quot;&quot; textblock inside macro end</span></li>
<li id="n_589" class="hl">            <span class="hl slc"># Avoid translating Markdown lines containing only markup</span></li>
<li id="n_590" class="hl">            do_paragraph<span class="hl opt">(</span><span class="hl kwb">$self</span><span class="hl opt">,</span><span class="hl kwb">$paragraph</span><span class="hl opt">,</span><span class="hl kwb">$wrapped_mode</span><span class="hl opt">);</span></li>
<li id="n_591" class="hl">            <span class="hl kwb">$paragraph</span><span class="hl opt">=</span><span class="hl sng">&quot;&quot;</span><span class="hl opt">;</span></li>
<li id="n_592" class="hl">            <span class="hl kwb">$wrapped_mode </span><span class="hl opt">= </span><span class="hl num">1</span><span class="hl opt">;</span></li>
<li id="n_593" class="hl">            <span class="hl kwb">$self</span><span class="hl opt">-&gt;</span><span class="hl kwd">pushline</span><span class="hl opt">(</span><span class="hl sng">&quot;</span><span class="hl ipl">$line</span><span class="hl sng"></span><span class="hl esc">\n</span><span class="hl sng">&quot;</span><span class="hl opt">);</span></li>
<li id="n_594" class="hl">        <span class="hl opt">} </span><span class="hl kwa">elsif </span><span class="hl opt">(</span><span class="hl kwb">$markdown </span><span class="hl kwc">and</span></li>
<li id="n_595" class="hl">                 <span class="hl opt">(   </span><span class="hl kwb">$line </span><span class="hl opt">=~ </span><span class="hl kwd">/^#/            </span><span class="hl slc"># headline</span></li>
<li id="n_596" class="hl">                  <span class="hl kwc">or </span><span class="hl kwb">$line </span><span class="hl opt">=~ </span><span class="hl kwd">/^\s*\[\[\!\S[^\]]*\]\]\s*$/</span><span class="hl opt">)) { </span><span class="hl slc"># sole macro</span></li>
<li id="n_597" class="hl">            <span class="hl slc"># Preserve some Markdown markup as a single line</span></li>
<li id="n_598" class="hl">            do_paragraph<span class="hl opt">(</span><span class="hl kwb">$self</span><span class="hl opt">,</span><span class="hl kwb">$paragraph</span><span class="hl opt">,</span><span class="hl kwb">$wrapped_mode</span><span class="hl opt">);</span></li>
<li id="n_599" class="hl">            <span class="hl kwb">$paragraph</span><span class="hl opt">=</span><span class="hl sng">&quot;</span><span class="hl ipl">$line</span><span class="hl sng"></span><span class="hl esc">\n</span><span class="hl sng">&quot;</span><span class="hl opt">;</span></li>
<li id="n_600" class="hl">            <span class="hl kwb">$wrapped_mode </span><span class="hl opt">= </span><span class="hl num">0</span><span class="hl opt">;</span></li>
<li id="n_601" class="hl">            <span class="hl kwb">$end_of_paragraph </span><span class="hl opt">= </span><span class="hl num">1</span><span class="hl opt">;</span></li>
<li id="n_602" class="hl">        <span class="hl opt">} </span><span class="hl kwa">elsif </span><span class="hl opt">(</span><span class="hl kwb">$markdown </span><span class="hl kwc">and</span></li>
<li id="n_603" class="hl">                 <span class="hl opt">(   </span><span class="hl kwb">$line </span><span class="hl opt">=~ </span><span class="hl kwd">/^&quot;&quot;&quot;/</span><span class="hl opt">)) { </span><span class="hl slc"># &quot;&quot;&quot; textblock inside macro end</span></li>
<li id="n_604" class="hl">            <span class="hl slc"># Markdown markup needing separation _before_ this line</span></li>
<li id="n_605" class="hl">            do_paragraph<span class="hl opt">(</span><span class="hl kwb">$self</span><span class="hl opt">,</span><span class="hl kwb">$paragraph</span><span class="hl opt">,</span><span class="hl kwb">$wrapped_mode</span><span class="hl opt">);</span></li>
<li id="n_606" class="hl">            <span class="hl kwb">$paragraph</span><span class="hl opt">=</span><span class="hl sng">&quot;</span><span class="hl ipl">$line</span><span class="hl sng"></span><span class="hl esc">\n</span><span class="hl sng">&quot;</span><span class="hl opt">;</span></li>
<li id="n_607" class="hl">            <span class="hl kwb">$wrapped_mode </span><span class="hl opt">= </span><span class="hl num">1</span><span class="hl opt">;</span></li>
<li id="n_608" class="hl">        <span class="hl opt">} </span><span class="hl kwa">elsif </span><span class="hl opt">(</span><span class="hl kwb">$tabs </span><span class="hl kwc">eq </span><span class="hl sng">&quot;split&quot;</span> <span class="hl kwc">and </span><span class="hl kwb">$line </span><span class="hl opt">=~ </span><span class="hl kwd">m/\t/ </span><span class="hl kwc">and </span><span class="hl kwb">$paragraph </span><span class="hl opt">!~ </span><span class="hl kwd">m/\t/s</span><span class="hl opt">) {</span></li>
<li id="n_609" class="hl">            <span class="hl kwb">$wrapped_mode </span><span class="hl opt">= </span><span class="hl num">0</span><span class="hl opt">;</span></li>
<li id="n_610" class="hl">            do_paragraph<span class="hl opt">(</span><span class="hl kwb">$self</span><span class="hl opt">,</span><span class="hl kwb">$paragraph</span><span class="hl opt">,</span><span class="hl kwb">$wrapped_mode</span><span class="hl opt">);</span></li>
<li id="n_611" class="hl">            <span class="hl kwb">$paragraph </span><span class="hl opt">= </span><span class="hl sng">&quot;</span><span class="hl ipl">$line</span><span class="hl sng"></span><span class="hl esc">\n</span><span class="hl sng">&quot;</span><span class="hl opt">;</span></li>
<li id="n_612" class="hl">            <span class="hl kwb">$wrapped_mode </span><span class="hl opt">= </span><span class="hl num">0</span><span class="hl opt">;</span></li>
<li id="n_613" class="hl">        <span class="hl opt">} </span><span class="hl kwa">elsif </span><span class="hl opt">(</span><span class="hl kwb">$tabs </span><span class="hl kwc">eq </span><span class="hl sng">&quot;split&quot;</span> <span class="hl kwc">and </span><span class="hl kwb">$line </span><span class="hl opt">!~ </span><span class="hl kwd">m/\t/ </span><span class="hl kwc">and </span><span class="hl kwb">$paragraph </span><span class="hl opt">=~ </span><span class="hl kwd">m/\t/s</span><span class="hl opt">) {</span></li>
<li id="n_614" class="hl">            do_paragraph<span class="hl opt">(</span><span class="hl kwb">$self</span><span class="hl opt">,</span><span class="hl kwb">$paragraph</span><span class="hl opt">,</span><span class="hl kwb">$wrapped_mode</span><span class="hl opt">);</span></li>
<li id="n_615" class="hl">            <span class="hl kwb">$paragraph </span><span class="hl opt">= </span><span class="hl sng">&quot;</span><span class="hl ipl">$line</span><span class="hl sng"></span><span class="hl esc">\n</span><span class="hl sng">&quot;</span><span class="hl opt">;</span></li>
<li id="n_616" class="hl">            <span class="hl kwb">$wrapped_mode </span><span class="hl opt">= </span><span class="hl num">1</span><span class="hl opt">;</span></li>
<li id="n_617" class="hl">        <span class="hl opt">} </span><span class="hl kwa">else </span><span class="hl opt">{</span></li>
<li id="n_618" class="hl">            <span class="hl kwa">if </span><span class="hl opt">(</span><span class="hl kwb">$line </span><span class="hl opt">=~ </span><span class="hl kwd">/^\s/</span><span class="hl opt">) {</span></li>
<li id="n_619" class="hl">                <span class="hl slc"># A line starting by a space indicates a non-wrap</span></li>
<li id="n_620" class="hl">                <span class="hl slc"># paragraph</span></li>
<li id="n_621" class="hl">                <span class="hl kwb">$wrapped_mode </span><span class="hl opt">= </span><span class="hl num">0</span><span class="hl opt">;</span></li>
<li id="n_622" class="hl">            <span class="hl opt">}</span></li>
<li id="n_623" class="hl">            <span class="hl kwa">if </span><span class="hl opt">(</span><span class="hl kwb">$markdown </span><span class="hl kwc">and</span></li>
<li id="n_624" class="hl">                     <span class="hl opt">(   </span><span class="hl kwb">$line </span><span class="hl opt">=~ </span><span class="hl kwd">/\S  $/    </span><span class="hl slc"># explicit newline</span></li>
<li id="n_625" class="hl">                      <span class="hl kwc">or </span><span class="hl kwb">$line </span><span class="hl opt">=~ </span><span class="hl kwd">/&quot;&quot;&quot;$/</span><span class="hl opt">)) { </span><span class="hl slc"># &quot;&quot;&quot; textblock inside macro begin</span></li>
<li id="n_626" class="hl">                <span class="hl slc"># Markdown markup needing separation _after_ this line</span></li>
<li id="n_627" class="hl">                <span class="hl kwb">$end_of_paragraph </span><span class="hl opt">= </span><span class="hl num">1</span><span class="hl opt">;</span></li>
<li id="n_628" class="hl">            <span class="hl opt">} </span><span class="hl kwa">else </span><span class="hl opt">{</span></li>
<li id="n_629" class="hl">                <span class="hl kwc">undef </span><span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>bullet<span class="hl opt">};</span></li>
<li id="n_630" class="hl">                <span class="hl kwc">undef </span><span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>indent<span class="hl opt">};</span></li>
<li id="n_631" class="hl">            <span class="hl opt">}</span></li>
<li id="n_632" class="hl">            <span class="hl kwa">if </span><span class="hl opt">(</span><span class="hl kwb">$fortunes</span><span class="hl opt">) {</span></li>
<li id="n_633" class="hl">                <span class="hl kwb">$line </span><span class="hl opt">=~ </span><span class="hl kwd">s/%%(.*)$//</span><span class="hl opt">;</span></li>
<li id="n_634" class="hl">            <span class="hl opt">}</span></li>
<li id="n_635" class="hl"><span class="hl slc"># TODO: comments</span></li>
<li id="n_636" class="hl">            <span class="hl kwb">$paragraph </span><span class="hl opt">.= </span><span class="hl kwb">$line</span><span class="hl opt">.</span><span class="hl sng">&quot;</span><span class="hl esc">\n</span><span class="hl sng">&quot;</span><span class="hl opt">;</span></li>
<li id="n_637" class="hl">        <span class="hl opt">}</span></li>
<li id="n_638" class="hl">        <span class="hl slc"># paragraphs starting by a bullet, or numbered</span></li>
<li id="n_639" class="hl">        <span class="hl slc"># or paragraphs with a line containing many consecutive spaces</span></li>
<li id="n_640" class="hl">        <span class="hl slc"># (more than 3)</span></li>
<li id="n_641" class="hl">        <span class="hl slc"># are considered as verbatim paragraphs</span></li>
<li id="n_642" class="hl">        <span class="hl kwb">$wrapped_mode </span><span class="hl opt">= </span><span class="hl num">0 </span><span class="hl kwa">if </span><span class="hl opt">(   </span><span class="hl kwb">$paragraph </span><span class="hl opt">=~ </span><span class="hl kwd">m/^(\*|[0-9]+[.)] )/s</span></li>
<li id="n_643" class="hl">                          <span class="hl kwc">or </span><span class="hl kwb">$paragraph </span><span class="hl opt">=~ </span><span class="hl kwd">m/[ \t][ \t][ \t]/s</span><span class="hl opt">);</span></li>
<li id="n_644" class="hl">        <span class="hl kwb">$wrapped_mode </span><span class="hl opt">= </span><span class="hl num">0 </span><span class="hl kwa">if </span><span class="hl opt">(    </span><span class="hl kwb">$tabs </span><span class="hl kwc">eq </span><span class="hl sng">&quot;verbatim&quot;</span></li>
<li id="n_645" class="hl">                              <span class="hl kwc">and </span><span class="hl kwb">$paragraph </span><span class="hl opt">=~ </span><span class="hl kwd">m/\t/s</span><span class="hl opt">);</span></li>
<li id="n_646" class="hl">        <span class="hl kwa">if </span><span class="hl opt">(</span><span class="hl kwb">$markdown</span><span class="hl opt">) {</span></li>
<li id="n_647" class="hl">            <span class="hl slc"># Some Markdown markup can (or might) not survive wrapping</span></li>
<li id="n_648" class="hl">            <span class="hl kwb">$wrapped_mode </span><span class="hl opt">= </span><span class="hl num">0 </span><span class="hl kwa">if </span><span class="hl opt">(</span></li>
<li id="n_649" class="hl">                   <span class="hl kwb">$paragraph </span><span class="hl opt">=~ </span><span class="hl kwd">/^&gt;/ms                  </span><span class="hl slc"># blockquote</span></li>
<li id="n_650" class="hl">                <span class="hl kwc">or </span><span class="hl kwb">$paragraph </span><span class="hl opt">=~ </span><span class="hl kwd">/^( {8}|\t)/ms          </span><span class="hl slc"># monospaced</span></li>
<li id="n_651" class="hl">                <span class="hl kwc">or </span><span class="hl kwb">$paragraph </span><span class="hl opt">=~ </span><span class="hl kwd">/^\$(\S+[{}]\S*\s*)+/ms </span><span class="hl slc"># Xapian macro</span></li>
<li id="n_652" class="hl">                <span class="hl kwc">or </span><span class="hl kwb">$paragraph </span><span class="hl opt">=~ </span><span class="hl kwd">/&lt;(?![a-z]+[:&#64;])/ms     </span><span class="hl slc"># maybe html (tags but not wiki &lt;URI&gt;)</span></li>
<li id="n_653" class="hl">                <span class="hl kwc">or </span><span class="hl kwb">$paragraph </span><span class="hl opt">=~ </span><span class="hl kwd">/^[^&lt;]+&gt;/ms             </span><span class="hl slc"># maybe html (tag with vertical space)</span></li>
<li id="n_654" class="hl">                <span class="hl kwc">or </span><span class="hl kwb">$paragraph </span><span class="hl opt">=~ </span><span class="hl kwd">/\S  $/ms               </span><span class="hl slc"># explicit newline</span></li>
<li id="n_655" class="hl">                <span class="hl kwc">or </span><span class="hl kwb">$paragraph </span><span class="hl opt">=~ </span><span class="hl kwd">/\[\[\!\S[^\]]+$/ms     </span><span class="hl slc"># macro begin</span></li>
<li id="n_656" class="hl">            <span class="hl opt">);</span></li>
<li id="n_657" class="hl">        <span class="hl opt">}</span></li>
<li id="n_658" class="hl">        <span class="hl kwa">if </span><span class="hl opt">(</span><span class="hl kwb">$end_of_paragraph</span><span class="hl opt">) {</span></li>
<li id="n_659" class="hl">            do_paragraph<span class="hl opt">(</span><span class="hl kwb">$self</span><span class="hl opt">,</span><span class="hl kwb">$paragraph</span><span class="hl opt">,</span><span class="hl kwb">$wrapped_mode</span><span class="hl opt">);</span></li>
<li id="n_660" class="hl">            <span class="hl kwb">$paragraph</span><span class="hl opt">=</span><span class="hl sng">&quot;&quot;</span><span class="hl opt">;</span></li>
<li id="n_661" class="hl">            <span class="hl kwb">$wrapped_mode </span><span class="hl opt">= </span><span class="hl num">1</span><span class="hl opt">;</span></li>
<li id="n_662" class="hl">            <span class="hl kwb">$end_of_paragraph </span><span class="hl opt">= </span><span class="hl num">0</span><span class="hl opt">;</span></li>
<li id="n_663" class="hl">        <span class="hl opt">}</span></li>
<li id="n_664" class="hl">        <span class="hl opt">(</span><span class="hl kwb">$line</span><span class="hl opt">,</span><span class="hl kwb">$ref</span><span class="hl opt">)=</span><span class="hl kwb">$self</span><span class="hl opt">-&gt;</span><span class="hl kwd">shiftline</span><span class="hl opt">();</span></li>
<li id="n_665" class="hl">    <span class="hl opt">}</span></li>
<li id="n_666" class="hl">    <span class="hl kwa">if </span><span class="hl opt">(</span><span class="hl kwc">length </span><span class="hl kwb">$paragraph</span><span class="hl opt">) {</span></li>
<li id="n_667" class="hl">        do_paragraph<span class="hl opt">(</span><span class="hl kwb">$self</span><span class="hl opt">,</span><span class="hl kwb">$paragraph</span><span class="hl opt">,</span><span class="hl kwb">$wrapped_mode</span><span class="hl opt">);</span></li>
<li id="n_668" class="hl">    <span class="hl opt">}</span></li>
<li id="n_669" class="hl"><span class="hl opt">}</span></li>
<li id="n_670" class="hl"></li>
<li id="n_671" class="hl"><span class="hl kwa">sub </span>do_paragraph <span class="hl opt">{</span></li>
<li id="n_672" class="hl">    <span class="hl kwc">my </span><span class="hl opt">(</span><span class="hl kwb">$self</span><span class="hl opt">, </span><span class="hl kwb">$paragraph</span><span class="hl opt">, </span><span class="hl kwb">$wrap</span><span class="hl opt">) = (</span><span class="hl kwc">shift</span><span class="hl opt">, </span><span class="hl kwc">shift</span><span class="hl opt">, </span><span class="hl kwc">shift</span><span class="hl opt">);</span></li>
<li id="n_673" class="hl">    <span class="hl kwc">my </span><span class="hl kwb">$type </span><span class="hl opt">= </span><span class="hl kwc">shift </span><span class="hl opt">|| </span><span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>type<span class="hl opt">} || </span><span class="hl sng">&quot;Plain text&quot;</span><span class="hl opt">;</span></li>
<li id="n_674" class="hl">    <span class="hl kwa">return if </span><span class="hl opt">(</span><span class="hl kwb">$paragraph </span><span class="hl kwc">eq </span><span class="hl sng">&quot;&quot;</span><span class="hl opt">);</span></li>
<li id="n_675" class="hl"></li>
<li id="n_676" class="hl"><span class="hl slc"># DEBUG</span></li>
<li id="n_677" class="hl"><span class="hl slc">#    my $b;</span></li>
<li id="n_678" class="hl"><span class="hl slc">#    if (defined $self-&gt;{bullet}) {</span></li>
<li id="n_679" class="hl"><span class="hl slc">#            $b = $self-&gt;{bullet};</span></li>
<li id="n_680" class="hl"><span class="hl slc">#    } else {</span></li>
<li id="n_681" class="hl"><span class="hl slc">#            $b = &quot;UNDEF&quot;;</span></li>
<li id="n_682" class="hl"><span class="hl slc">#    }</span></li>
<li id="n_683" class="hl"><span class="hl slc">#    $type .= &quot; verbatim: &#39;&quot;.($self-&gt;{verbatim}||&quot;NONE&quot;).&quot;&#39; bullet: &#39;$b&#39; indent: &#39;&quot;.($self-&gt;{indent}||&quot;NONE&quot;).&quot;&#39; type: &#39;&quot;.($self-&gt;{type}||&quot;NONE&quot;).&quot;&#39;&quot;;</span></li>
<li id="n_684" class="hl"></li>
<li id="n_685" class="hl">    <span class="hl kwa">if </span><span class="hl opt">(</span><span class="hl kwb">$bullets </span><span class="hl kwc">and not </span><span class="hl kwb">$wrap </span><span class="hl kwc">and not defined </span><span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>verbatim<span class="hl opt">}) {</span></li>
<li id="n_686" class="hl">        <span class="hl slc"># Detect bullets</span></li>
<li id="n_687" class="hl">        <span class="hl slc"># |        * blah blah</span></li>
<li id="n_688" class="hl">        <span class="hl slc"># |&lt;spaces&gt;  blah</span></li>
<li id="n_689" class="hl">        <span class="hl slc"># |          ^-- aligned</span></li>
<li id="n_690" class="hl">        <span class="hl slc"># &lt;empty line&gt;</span></li>
<li id="n_691" class="hl">        <span class="hl slc">#</span></li>
<li id="n_692" class="hl">        <span class="hl slc"># Other bullets supported:</span></li>
<li id="n_693" class="hl">        <span class="hl slc"># - blah         o blah         + blah</span></li>
<li id="n_694" class="hl">        <span class="hl slc"># 1. blah       1) blah       (1) blah</span></li>
<li id="n_695" class="hl">TEST_BULLET<span class="hl opt">:</span></li>
<li id="n_696" class="hl">        <span class="hl kwa">if </span><span class="hl opt">(</span><span class="hl kwb">$paragraph </span><span class="hl opt">=~ </span><span class="hl kwd">m/^(\s*)((?:[-*o+]|([0-9]+[.\)])|\([0-9]+\))\s+)([^\n]*\n)(.*)$/s</span><span class="hl opt">) {</span></li>
<li id="n_697" class="hl">            <span class="hl kwc">my </span><span class="hl kwb">$para </span><span class="hl opt">= </span><span class="hl kwb">$5</span><span class="hl opt">;</span></li>
<li id="n_698" class="hl">            <span class="hl kwc">my </span><span class="hl kwb">$bullet </span><span class="hl opt">= </span><span class="hl kwb">$2</span><span class="hl opt">;</span></li>
<li id="n_699" class="hl">            <span class="hl kwc">my </span><span class="hl kwb">$indent1 </span><span class="hl opt">= </span><span class="hl kwb">$1</span><span class="hl opt">;</span></li>
<li id="n_700" class="hl">            <span class="hl kwc">my </span><span class="hl kwb">$indent2 </span><span class="hl opt">= </span><span class="hl sng">&quot;</span><span class="hl ipl">$1</span><span class="hl sng">&quot;</span><span class="hl opt">.(</span><span class="hl sng">&#39; &#39;</span> x <span class="hl kwc">length </span><span class="hl kwb">$bullet</span><span class="hl opt">);</span></li>
<li id="n_701" class="hl">            <span class="hl kwc">my </span><span class="hl kwb">$text </span><span class="hl opt">= </span><span class="hl kwb">$4</span><span class="hl opt">;</span></li>
<li id="n_702" class="hl">            <span class="hl kwa">while </span><span class="hl opt">(</span><span class="hl kwb">$para </span><span class="hl opt">!~ </span><span class="hl kwd">m/$indent2(?:[-*o+]|([0-9]+[.\)])|\([0-9]+\))\s+/</span></li>
<li id="n_703" class="hl">                   <span class="hl kwc">and </span><span class="hl kwb">$para </span><span class="hl opt">=~ </span><span class="hl kwd">s/^$indent2(\S[^\n]*\n)//s</span><span class="hl opt">) {</span></li>
<li id="n_704" class="hl">                <span class="hl kwb">$text </span><span class="hl opt">.= </span><span class="hl kwb">$1</span><span class="hl opt">;</span></li>
<li id="n_705" class="hl">            <span class="hl opt">}</span></li>
<li id="n_706" class="hl">            <span class="hl slc"># TODO: detect if a line starts with the same bullet</span></li>
<li id="n_707" class="hl">            <span class="hl kwa">if </span><span class="hl opt">(</span><span class="hl kwb">$text </span><span class="hl opt">!~ </span><span class="hl kwd">m/\S[ \t][ \t][ \t]+\S/s</span><span class="hl opt">) {</span></li>
<li id="n_708" class="hl">                <span class="hl kwc">my </span><span class="hl kwb">$bullet_regex </span><span class="hl opt">= </span><span class="hl kwc">quotemeta</span><span class="hl opt">(</span><span class="hl kwb">$indent1</span><span class="hl opt">.</span><span class="hl kwb">$bullet</span><span class="hl opt">);</span></li>
<li id="n_709" class="hl">                <span class="hl kwb">$bullet_regex </span><span class="hl opt">=~ </span><span class="hl kwd">s/[0-9]+/\\d\+/</span><span class="hl opt">;</span></li>
<li id="n_710" class="hl">                <span class="hl kwa">if </span><span class="hl opt">(</span><span class="hl kwb">$para </span><span class="hl kwc">eq </span><span class="hl sng">&#39;&#39;</span> <span class="hl kwc">or </span><span class="hl kwb">$para </span><span class="hl opt">=~ </span><span class="hl kwd">m/^$bullet_regex\S/s</span><span class="hl opt">) {</span></li>
<li id="n_711" class="hl">                    <span class="hl kwc">my </span><span class="hl kwb">$trans </span><span class="hl opt">= </span><span class="hl kwb">$self</span><span class="hl opt">-&gt;</span><span class="hl kwd">translate</span><span class="hl opt">(</span><span class="hl kwb">$text</span><span class="hl opt">,</span></li>
<li id="n_712" class="hl">                                                 <span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span><span class="hl kwc">ref</span><span class="hl opt">},</span></li>
<li id="n_713" class="hl">                                                 <span class="hl sng">&quot;Bullet: &#39;</span><span class="hl ipl">$indent1$bullet</span><span class="hl sng">&#39;&quot;</span><span class="hl opt">,</span></li>
<li id="n_714" class="hl">                                                 <span class="hl sng">&quot;wrap&quot;</span> <span class="hl opt">=&gt; </span><span class="hl num">1</span><span class="hl opt">,</span></li>
<li id="n_715" class="hl">                                                 <span class="hl sng">&quot;wrapcol&quot;</span> <span class="hl opt">=&gt; - (</span><span class="hl kwc">length </span><span class="hl kwb">$indent2</span><span class="hl opt">));</span></li>
<li id="n_716" class="hl">                    <span class="hl kwb">$trans </span><span class="hl opt">=~ </span><span class="hl kwd">s/^/$indent1$bullet/s</span><span class="hl opt">;</span></li>
<li id="n_717" class="hl">                    <span class="hl kwb">$trans </span><span class="hl opt">=~ </span><span class="hl kwd">s/\n(.)/\n$indent2$1/sg</span><span class="hl opt">;</span></li>
<li id="n_718" class="hl">                    <span class="hl kwb">$self</span><span class="hl opt">-&gt;</span><span class="hl kwd">pushline</span><span class="hl opt">( </span><span class="hl kwb">$trans</span><span class="hl opt">.</span><span class="hl sng">&quot;</span><span class="hl esc">\n</span><span class="hl sng">&quot;</span> <span class="hl opt">);</span></li>
<li id="n_719" class="hl">                    <span class="hl kwa">if </span><span class="hl opt">(</span><span class="hl kwb">$para </span><span class="hl kwc">eq </span><span class="hl sng">&#39;&#39;</span><span class="hl opt">) {</span></li>
<li id="n_720" class="hl">                        <span class="hl kwa">return</span><span class="hl opt">;</span></li>
<li id="n_721" class="hl">                    <span class="hl opt">} </span><span class="hl kwa">else </span><span class="hl opt">{</span></li>
<li id="n_722" class="hl">                        <span class="hl slc"># Another bullet</span></li>
<li id="n_723" class="hl">                        <span class="hl kwb">$paragraph </span><span class="hl opt">= </span><span class="hl kwb">$para</span><span class="hl opt">;</span></li>
<li id="n_724" class="hl">                        <span class="hl kwa">goto </span>TEST_BULLET<span class="hl opt">;</span></li>
<li id="n_725" class="hl">                    <span class="hl opt">}</span></li>
<li id="n_726" class="hl">                <span class="hl opt">}</span></li>
<li id="n_727" class="hl">            <span class="hl opt">}</span></li>
<li id="n_728" class="hl">        <span class="hl opt">}</span></li>
<li id="n_729" class="hl">    <span class="hl opt">}</span></li>
<li id="n_730" class="hl"></li>
<li id="n_731" class="hl">    <span class="hl kwc">my </span><span class="hl kwb">$end </span><span class="hl opt">= </span><span class="hl sng">&quot;&quot;</span><span class="hl opt">;</span></li>
<li id="n_732" class="hl">    <span class="hl kwa">if </span><span class="hl opt">(</span><span class="hl kwb">$wrap</span><span class="hl opt">) {</span></li>
<li id="n_733" class="hl">        <span class="hl kwb">$paragraph </span><span class="hl opt">=~ </span><span class="hl kwd">s/^(.*?)(\n*)$/$1/s</span><span class="hl opt">;</span></li>
<li id="n_734" class="hl">        <span class="hl kwb">$end </span><span class="hl opt">= </span><span class="hl kwb">$2 </span><span class="hl opt">|| </span><span class="hl sng">&quot;&quot;</span><span class="hl opt">;</span></li>
<li id="n_735" class="hl">    <span class="hl opt">}</span></li>
<li id="n_736" class="hl">    <span class="hl kwc">my </span><span class="hl kwb">$t </span><span class="hl opt">= </span><span class="hl kwb">$self</span><span class="hl opt">-&gt;</span><span class="hl kwd">translate</span><span class="hl opt">(</span><span class="hl kwb">$paragraph</span><span class="hl opt">,</span></li>
<li id="n_737" class="hl">                             <span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span><span class="hl kwc">ref</span><span class="hl opt">},</span></li>
<li id="n_738" class="hl">                             <span class="hl kwb">$type</span><span class="hl opt">,</span></li>
<li id="n_739" class="hl">                             <span class="hl sng">&quot;wrap&quot;</span> <span class="hl opt">=&gt; </span><span class="hl kwb">$wrap</span><span class="hl opt">);</span></li>
<li id="n_740" class="hl">    <span class="hl kwa">if </span><span class="hl opt">(</span><span class="hl kwc">defined </span><span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>bullet<span class="hl opt">}) {</span></li>
<li id="n_741" class="hl">        <span class="hl kwc">my </span><span class="hl kwb">$bullet </span><span class="hl opt">= </span><span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>bullet<span class="hl opt">};</span></li>
<li id="n_742" class="hl">        <span class="hl kwc">my </span><span class="hl kwb">$indent1 </span><span class="hl opt">= </span><span class="hl kwb">$self</span><span class="hl opt">-&gt;{</span>indent<span class="hl opt">};</span></li>
<li id="n_743" class="hl">        <span class="hl kwc">my </span><span class="hl kwb">$indent2 </span><span class="hl opt">= </span><span class="hl kwb">$indent1</span><span class="hl opt">.(</span><span class="hl sng">&#39; &#39;</span> x <span class="hl kwc">length</span><span class="hl opt">(</span><span class="hl kwb">$bullet</span><span class="hl opt">));</span></li>
<li id="n_744" class="hl">        <span class="hl kwb">$t </span><span class="hl opt">=~ </span><span class="hl kwd">s/^/$indent1$bullet/s</span><span class="hl opt">;</span></li>
<li id="n_745" class="hl">        <span class="hl kwb">$t </span><span class="hl opt">=~ </span><span class="hl kwd">s/\n(.)/\n$indent2$1/sg</span><span class="hl opt">;</span></li>
<li id="n_746" class="hl">    <span class="hl opt">}</span></li>
<li id="n_747" class="hl">    <span class="hl kwb">$self</span><span class="hl opt">-&gt;</span><span class="hl kwd">pushline</span><span class="hl opt">( </span><span class="hl kwb">$t</span><span class="hl opt">.</span><span class="hl kwb">$end </span><span class="hl opt">);</span></li>
<li id="n_748" class="hl"><span class="hl opt">}</span></li>
<li id="n_749" class="hl"></li>
<li id="n_750" class="hl"><span class="hl num">1</span><span class="hl opt">;</span></li>
<li id="n_751" class="hl"></li>
<li id="n_752" class="hl"><span class="hl com">=head1 STATUS OF THIS MODULE</span></li>
<li id="n_753" class="hl"><span class="hl com"></span></li>
<li id="n_754" class="hl"><span class="hl com">Tested successfully on simple text files and NEWS.Debian files.</span></li>
<li id="n_755" class="hl"><span class="hl com"></span></li>
<li id="n_756" class="hl"><span class="hl com">=head1 AUTHORS</span></li>
<li id="n_757" class="hl"><span class="hl com"></span></li>
<li id="n_758" class="hl"><span class="hl com"> Nicolas François &lt;nicolas.francois&#64;centraliens.net&gt;</span></li>
<li id="n_759" class="hl"><span class="hl com"></span></li>
<li id="n_760" class="hl"><span class="hl com">=head1 COPYRIGHT AND LICENSE</span></li>
<li id="n_761" class="hl"><span class="hl com"></span></li>
<li id="n_762" class="hl"><span class="hl com"> Copyright 2005-2008 by Nicolas FRANÇOIS &lt;nicolas.francois&#64;centraliens.net&gt;.</span></li>
<li id="n_763" class="hl"><span class="hl com"></span></li>
<li id="n_764" class="hl"><span class="hl com">This program is free software; you may redistribute it and/or modify it</span></li>
<li id="n_765" class="hl"><span class="hl com">under the terms of GPL (see the COPYING file).</span></li>
</ol></code></pre></td></tr></table>
</div> <!-- class=content -->
<div class='footer'>generated by <a href='https://git.zx2c4.com/cgit/about/'>cgit v1.2.3</a> (<a href='https://git-scm.com/'>git 2.46.0</a>) at 2025-07-23 07:39:41 +0000</div>
</div> <!-- id=cgit -->
</body>
</html>
