File Coverage

lib/MKDoc/Text/Structured/Inline.pm
Criterion Covered Total %
statement 141 141 100.0
branch 8 8 100.0
condition 2 2 100.0
subroutine 22 22 100.0
pod 0 2 0.0
total 173 175 98.8


line stmt bran cond sub pod time code
1             package MKDoc::Text::Structured::Inline;
2 21     21   57281 use URI::Find;
  21         311477  
  21         1622  
3 21     21   235 use warnings;
  21         46  
  21         641  
4 21     21   105 use strict;
  21         44  
  21         36553  
5              
6             our $Text = '';
7              
8             our $LongestWord = 78;
9             our $NoFollow = 0;
10              
11             =head1 NAME
12              
13             MKDoc::Text::Structured::Inline - convert text to HTML without handling block-level tags
14              
15             =head1 SYNOPSIS
16              
17             my $text = some_structured_text();
18             my $this = MKDoc::Text::Structured::Inline::process ($text);
19             my $that = MKDoc::Text::Structured::Inline::process_entities_only ($text);
20              
21             =head1 SUMMARY
22              
23             L is used by L to
24             generate inline HTML elements such as hyperlinks, emphasis and entities.
25              
26             This module is also useful directly when the full block-level rendering of
27             L is unwanted.
28              
29             =head1 USAGE
30              
31             =head2 Processing text and adding HTML tags
32              
33             For example, when processing text that is going to end up in an

header,

34             you wouldn't want any block level tags generated:
35              
36             $header = "< My (c) symbol should be *bold* > -- and http://example.com/ 'linked'";
37             $header = MKDoc::Text::Structured::Inline::process ($title);
38              
39             $header is now:
40              
41             < My © symbol should be bold > — and http://example.com/ ‘linked’
42              
43             =cut
44              
45             sub process
46             {
47 93     93 0 160 local $Text;
48 93         169 $Text = shift;
49 93         247 $Text = " $Text ";
50 93         206 $Text =~ s/\n/ /gsm;
51              
52 93         223 _make_entities();
53              
54 93         167 $Text =~ s/>/ >/g;
55             # automagically finds hyperlinks
56             my $finder = URI::Find->new (
57             sub {
58 10     10   62553 my ($uri, $orig_uri) = @_;
59 10         34 $orig_uri =~ s/^mailto://;
60              
61             # http://googleblog.blogspot.com/2005/01/preventing-comment-spam.html
62 10 100       52 if ($NoFollow)
63             {
64 3         14 return qq|$orig_uri|;
65             }
66             else
67             {
68 7         31 return qq|$orig_uri|;
69             }
70             }
71 93         1254 );
72 93         1439 $finder->find (\$Text);
73 93         33405 $Text =~ s/ >/>/g;
74              
75             # abbreviations
76 93         379 while ($Text =~ s/([[:upper:]][[:upper:]]+)\s+(\(.*?\))/_make_abbr_implicit ($1, $2)/e) {}; # implicit
  2         10  
77 93         492 while ($Text =~ s/([[:upper:]][[:upper:]]+)(\(.*?\))/_make_abbr_explicit ($1, $2)/e) {}; # explicit
  9         37  
78 93         245 _make_simplequotes();
79 93         286 _make_doublequotes();
80 93         272 _make_strong();
81 93         257 _make_em();
82 93         263 _make_smilies();
83 93         319 _break_long_words();
84              
85 93         386 $Text =~ s/^ //;
86 93         405 $Text =~ s/ $//;
87 93         1138 return $Text;
88             }
89              
90             =pod
91              
92             =head2 Processing text without adding tags
93              
94             Another example, if you were processing text that will end up in an HTML
95             tag, this tag should never contain any other tags, so you should use </td> </tr> <tr> <td class="h" > <a name="96">96</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> the MKDoc::Text::Structured::Inline::process_entities_only() method: </td> </tr> <tr> <td class="h" > <a name="97">97</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="98">98</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $title = "< My (c) symbol shouldn't be *bold* > -- or http://example.com/ 'linked'"; </td> </tr> <tr> <td class="h" > <a name="99">99</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $title = MKDoc::Text::Structured::Inline::process_entities_only ($title); </td> </tr> <tr> <td class="h" > <a name="100">100</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="101">101</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $title is now: </td> </tr> <tr> <td class="h" > <a name="102">102</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="103">103</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> < My © symbol shouldn't be *bold* — > or http://example.com/ ‘linked’ </td> </tr> <tr> <td class="h" > <a name="104">104</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="105">105</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =cut </td> </tr> <tr> <td class="h" > <a name="106">106</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="107">107</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub process_entities_only </td> </tr> <tr> <td class="h" > <a name="108">108</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> { </td> </tr> <tr> <td class="h" > <a name="109">109</a> </td> <td class="c3" > 2 </td> <td >   </td> <td >   </td> <td class="c3" > <a href="lib-MKDoc-Text-Structured-Inline-pm--subroutine.html#109-1"> 2 </a> </td> <td class="c0" > <a href="lib-MKDoc-Text-Structured-Inline-pm--subroutine.html#109-1"> 0 </a> </td> <td > 955 </td> <td class="s"> local $Text; </td> </tr> <tr> <td class="h" > <a name="110">110</a> </td> <td class="c3" > 2 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 2 </td> <td class="s"> $Text = shift; </td> </tr> <tr> <td class="h" > <a name="111">111</a> </td> <td class="c3" > 2 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 6 </td> <td class="s"> $Text = " $Text "; </td> </tr> <tr> <td class="h" > <a name="112">112</a> </td> <td class="c3" > 2 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 5 </td> <td class="s"> $Text =~ s/\n/ /gsm; </td> </tr> <tr> <td class="h" > <a name="113">113</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="114">114</a> </td> <td class="c3" > 2 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 5 </td> <td class="s"> _make_entities(); </td> </tr> <tr> <td class="h" > <a name="115">115</a> </td> <td class="c3" > 2 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 6 </td> <td class="s"> _make_simplequotes(); </td> </tr> <tr> <td class="h" > <a name="116">116</a> </td> <td class="c3" > 2 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 6 </td> <td class="s"> _make_doublequotes(); </td> </tr> <tr> <td class="h" > <a name="117">117</a> </td> <td class="c3" > 2 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 5 </td> <td class="s"> _break_long_words(); </td> </tr> <tr> <td class="h" > <a name="118">118</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> </td> </tr> <tr> <td class="h" > <a name="119">119</a> </td> <td class="c3" > 2 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 6 </td> <td class="s"> $Text =~ s/^ //; </td> </tr> <tr> <td class="h" > <a name="120">120</a> </td> <td class="c3" > 2 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 5 </td> <td class="s"> $Text =~ s/ $//; </td> </tr> <tr> <td class="h" > <a name="121">121</a> </td> <td class="c3" > 2 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 6 </td> <td class="s"> return $Text; </td> </tr> <tr> <td class="h" > <a name="122">122</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="123">123</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="124">124</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="125">125</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub _make_entities </td> </tr> <tr> <td class="h" > <a name="126">126</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> { </td> </tr> <tr> <td class="h" > <a name="127">127</a> </td> <td class="c3" > 95 </td> <td >   </td> <td >   </td> <td class="c3" > <a href="lib-MKDoc-Text-Structured-Inline-pm--subroutine.html#127-1"> 95 </a> </td> <td >   </td> <td > 340 </td> <td class="s"> $Text =~ s/&/&/g; </td> </tr> <tr> <td class="h" > <a name="128">128</a> </td> <td class="c3" > 95 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 166 </td> <td class="s"> $Text =~ s/</</g; </td> </tr> <tr> <td class="h" > <a name="129">129</a> </td> <td class="c3" > 95 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 166 </td> <td class="s"> $Text =~ s/>/>/g; </td> </tr> <tr> <td class="h" > <a name="130">130</a> </td> <td class="c3" > 95 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 165 </td> <td class="s"> $Text =~ s/"/"/g; </td> </tr> <tr> <td class="h" > <a name="131">131</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="132">132</a> </td> <td class="c3" > 95 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 183 </td> <td class="s"> $Text =~ s/(?<=(?:\s|\n))--(?=(?:\s|\n))/\—/g; # -- becomes em-dash </td> </tr> <tr> <td class="h" > <a name="133">133</a> </td> <td class="c3" > 95 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 184 </td> <td class="s"> $Text =~ s/(?<=(?:\s|\n))-(?=(?:\s|\n))/\–/g; # - becomes en-dash </td> </tr> <tr> <td class="h" > <a name="134">134</a> </td> <td class="c3" > 95 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 229 </td> <td class="s"> $Text =~ s/(?<!\.)\.\.\.(?!\.)/\…/g; # ... becomes ellipsis </td> </tr> <tr> <td class="h" > <a name="135">135</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="136">136</a> </td> <td class="c3" > 21 </td> <td >   </td> <td >   </td> <td class="c3" > <a href="lib-MKDoc-Text-Structured-Inline-pm--subroutine.html#136-1"> 21 </a> </td> <td >   </td> <td > 40006 </td> <td class="s"> $Text =~ s/\(tm\)(?=(?:\s|\n|\p{IsPunct}))/\™/gi; # (tm) becomes trademark </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c3" > 21 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 241 </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c3" > 21 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 321 </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c3" > 95 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 223 </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="137">137</a> </td> <td class="c3" > 95 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 351 </td> <td class="s"> $Text =~ s/\(r\)(?=(?:\s|\n|\p{IsPunct}))/\®/gi; # (r) becomes registered </td> </tr> <tr> <td class="h" > <a name="138">138</a> </td> <td class="c3" > 95 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 210 </td> <td class="s"> $Text =~ s/\(c\)(?=(?:\s|\n|\p{IsPunct}))/\©/gi; # (c) becomes copyright </td> </tr> <tr> <td class="h" > <a name="139">139</a> </td> <td class="c3" > 95 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 210 </td> <td class="s"> $Text =~ s/(?<=(?:\s|\n))(\d+)\s*x\s*(\d+)(?=(?:\s|\n|\p{isPunct}))/$1\×$2/g; # x becomes dimension </td> </tr> <tr> <td class="h" > <a name="140">140</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="141">141</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="142">142</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="143">143</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub _make_abbr_implicit </td> </tr> <tr> <td class="h" > <a name="144">144</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> { </td> </tr> <tr> <td class="h" > <a name="145">145</a> </td> <td class="c3" > 2 </td> <td >   </td> <td >   </td> <td class="c3" > <a href="lib-MKDoc-Text-Structured-Inline-pm--subroutine.html#145-1"> 2 </a> </td> <td >   </td> <td > 6 </td> <td class="s"> my $abbr = shift; </td> </tr> <tr> <td class="h" > <a name="146">146</a> </td> <td class="c3" > 2 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 5 </td> <td class="s"> my $brack = shift; </td> </tr> <tr> <td class="h" > <a name="147">147</a> </td> <td class="c3" > 2 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 4 </td> <td class="s"> my $title = $brack; </td> </tr> <tr> <td class="h" > <a name="148">148</a> </td> <td class="c3" > 2 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 11 </td> <td class="s"> $title =~ s/^\s*\(\s*//; </td> </tr> <tr> <td class="h" > <a name="149">149</a> </td> <td class="c3" > 2 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 12 </td> <td class="s"> $title =~ s/\s*\)\s*$//; </td> </tr> <tr> <td class="h" > <a name="150">150</a> </td> <td class="c3" > 2 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 31 </td> <td class="s"> return qq|<abbr title="$title">$abbr</abbr> ($title)|; </td> </tr> <tr> <td class="h" > <a name="151">151</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="152">152</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="153">153</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="154">154</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub _make_abbr_explicit </td> </tr> <tr> <td class="h" > <a name="155">155</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> { </td> </tr> <tr> <td class="h" > <a name="156">156</a> </td> <td class="c3" > 9 </td> <td >   </td> <td >   </td> <td class="c3" > <a href="lib-MKDoc-Text-Structured-Inline-pm--subroutine.html#156-1"> 9 </a> </td> <td >   </td> <td > 24 </td> <td class="s"> my $abbr = shift; </td> </tr> <tr> <td class="h" > <a name="157">157</a> </td> <td class="c3" > 9 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 19 </td> <td class="s"> my $brack = shift; </td> </tr> <tr> <td class="h" > <a name="158">158</a> </td> <td class="c3" > 9 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 18 </td> <td class="s"> my $title = $brack; </td> </tr> <tr> <td class="h" > <a name="159">159</a> </td> <td class="c3" > 9 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 47 </td> <td class="s"> $title =~ s/^\s*\(\s*//; </td> </tr> <tr> <td class="h" > <a name="160">160</a> </td> <td class="c3" > 9 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 57 </td> <td class="s"> $title =~ s/\s*\)\s*$//; </td> </tr> <tr> <td class="h" > <a name="161">161</a> </td> <td class="c3" > 9 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 263 </td> <td class="s"> return qq|<abbr title="$title">$abbr</abbr>|; </td> </tr> <tr> <td class="h" > <a name="162">162</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="163">163</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="164">164</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="165">165</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub _make_simplequotes </td> </tr> <tr> <td class="h" > <a name="166">166</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> { </td> </tr> <tr> <td class="h" > <a name="167">167</a> </td> <td class="c3" > 179 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 411 </td> <td class="s"> $Text = join '', map { </td> </tr> <tr> <td class="h" > <a name="168">168</a> </td> <td class="c3" > 95 </td> <td >   </td> <td >   </td> <td class="c3" > <a href="lib-MKDoc-Text-Structured-Inline-pm--subroutine.html#168-1"> 95 </a> </td> <td >   </td> <td > 272 </td> <td class="s"> my $stuff = $_; </td> </tr> <tr> <td class="h" > <a name="169">169</a> </td> <td class="c3" > 179 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 355 </td> <td class="s"> $stuff = " $stuff "; </td> </tr> <tr> <td class="h" > <a name="170">170</a> </td> <td class="c3" > 179 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 647 </td> <td class="s"> while ($stuff =~ s/ </td> </tr> <tr> <td class="h" > <a name="171">171</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> (?<=(?:\s|\n)) # must start with space or carriage return </td> </tr> <tr> <td class="h" > <a name="172">172</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> \' # simple quote </td> </tr> <tr> <td class="h" > <a name="173">173</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ([^ \t\n\']|[^ \t\n\'].*?[^ \t\n\']) # stuff to capture and smart-quotize </td> </tr> <tr> <td class="h" > <a name="174">174</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> \' # simple quote </td> </tr> <tr> <td class="h" > <a name="175">175</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> (?=(?:<|\s|\n|\p{IsPunct}(?:\s|\n|<))) # must be followed by space, \n or (punctuation + space or \n) </td> </tr> <tr> <td class="h" > <a name="176">176</a> </td> <td class="c3" > 6 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 22 </td> <td class="s"> /_make_simplequotes_wrap ($1)/xes) {} </td> </tr> <tr> <td class="h" > <a name="177">177</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> </td> </tr> <tr> <td class="h" > <a name="178">178</a> </td> <td class="c3" > 179 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 584 </td> <td class="s"> $stuff =~ s/^ //; </td> </tr> <tr> <td class="h" > <a name="179">179</a> </td> <td class="c3" > 179 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 774 </td> <td class="s"> $stuff =~ s/ $//; </td> </tr> <tr> <td class="h" > <a name="180">180</a> </td> <td class="c3" > 179 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 792 </td> <td class="s"> $stuff; </td> </tr> <tr> <td class="h" > <a name="181">181</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } _tokenize ($Text); </td> </tr> <tr> <td class="h" > <a name="182">182</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="183">183</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="184">184</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="185">185</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub _make_simplequotes_wrap </td> </tr> <tr> <td class="h" > <a name="186">186</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> { </td> </tr> <tr> <td class="h" > <a name="187">187</a> </td> <td class="c3" > 6 </td> <td >   </td> <td >   </td> <td class="c3" > <a href="lib-MKDoc-Text-Structured-Inline-pm--subroutine.html#187-1"> 6 </a> </td> <td >   </td> <td > 15 </td> <td class="s"> my $stuff = shift; </td> </tr> <tr> <td class="h" > <a name="188">188</a> </td> <td class="c3" > 6 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 14 </td> <td class="s"> local $Text = $stuff; </td> </tr> <tr> <td class="h" > <a name="189">189</a> </td> <td class="c3" > 6 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 53 </td> <td class="s"> return "‘$Text’"; </td> </tr> <tr> <td class="h" > <a name="190">190</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="191">191</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="192">192</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="193">193</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="194">194</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub _make_doublequotes </td> </tr> <tr> <td class="h" > <a name="195">195</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> { </td> </tr> <tr> <td class="h" > <a name="196">196</a> </td> <td class="c3" > 179 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 256 </td> <td class="s"> $Text = join '', map { </td> </tr> <tr> <td class="h" > <a name="197">197</a> </td> <td class="c3" > 95 </td> <td >   </td> <td >   </td> <td class="c3" > <a href="lib-MKDoc-Text-Structured-Inline-pm--subroutine.html#197-1"> 95 </a> </td> <td >   </td> <td > 213 </td> <td class="s"> my $stuff = $_; </td> </tr> <tr> <td class="h" > <a name="198">198</a> </td> <td class="c3" > 179 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 342 </td> <td class="s"> $stuff = " $stuff "; </td> </tr> <tr> <td class="h" > <a name="199">199</a> </td> <td class="c3" > 179 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 462 </td> <td class="s"> $stuff =~ s/"/<QUOT>/g; </td> </tr> <tr> <td class="h" > <a name="200">200</a> </td> <td class="c3" > 179 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 534 </td> <td class="s"> $stuff =~ s/"/"/g; </td> </tr> <tr> <td class="h" > <a name="201">201</a> </td> <td class="c3" > 179 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 534 </td> <td class="s"> while ($stuff =~ s/ </td> </tr> <tr> <td class="h" > <a name="202">202</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> (?<=(?:\s|\n)) # must start with space or carriage return </td> </tr> <tr> <td class="h" > <a name="203">203</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> \" # double quote </td> </tr> <tr> <td class="h" > <a name="204">204</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ([^ \t\n\"]|[^ \t\n\"].*?[^ \t\n\"]) # stuff to capture and smart-quotize </td> </tr> <tr> <td class="h" > <a name="205">205</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> \" # double quote </td> </tr> <tr> <td class="h" > <a name="206">206</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> (?=(?:<|\s|\n|\p{IsPunct}(?:\s|\n|<))) # must be followed by space, \n or (punctuation + space or \n) </td> </tr> <tr> <td class="h" > <a name="207">207</a> </td> <td class="c3" > 6 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 20 </td> <td class="s"> /_make_doublequotes_wrap ($1)/xes) {} </td> </tr> <tr> <td class="h" > <a name="208">208</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> </td> </tr> <tr> <td class="h" > <a name="209">209</a> </td> <td class="c3" > 179 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 554 </td> <td class="s"> $stuff =~ s/^ //; </td> </tr> <tr> <td class="h" > <a name="210">210</a> </td> <td class="c3" > 179 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 585 </td> <td class="s"> $stuff =~ s/ $//; </td> </tr> <tr> <td class="h" > <a name="211">211</a> </td> <td class="c3" > 179 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 346 </td> <td class="s"> $stuff =~ s/"/"/g; </td> </tr> <tr> <td class="h" > <a name="212">212</a> </td> <td class="c3" > 179 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 295 </td> <td class="s"> $stuff =~ s/<QUOT>/"/g; </td> </tr> <tr> <td class="h" > <a name="213">213</a> </td> <td class="c3" > 179 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 571 </td> <td class="s"> $stuff; </td> </tr> <tr> <td class="h" > <a name="214">214</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } _tokenize ($Text); </td> </tr> <tr> <td class="h" > <a name="215">215</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="216">216</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="217">217</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="218">218</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub _make_doublequotes_wrap </td> </tr> <tr> <td class="h" > <a name="219">219</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> { </td> </tr> <tr> <td class="h" > <a name="220">220</a> </td> <td class="c3" > 6 </td> <td >   </td> <td >   </td> <td class="c3" > <a href="lib-MKDoc-Text-Structured-Inline-pm--subroutine.html#220-1"> 6 </a> </td> <td >   </td> <td > 60 </td> <td class="s"> my $stuff = shift; </td> </tr> <tr> <td class="h" > <a name="221">221</a> </td> <td class="c3" > 6 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 13 </td> <td class="s"> local $Text = $stuff; </td> </tr> <tr> <td class="h" > <a name="222">222</a> </td> <td class="c3" > 6 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 54 </td> <td class="s"> return "“$Text”"; </td> </tr> <tr> <td class="h" > <a name="223">223</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="224">224</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="225">225</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="226">226</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub _make_strong </td> </tr> <tr> <td class="h" > <a name="227">227</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> { </td> </tr> <tr> <td class="h" > <a name="228">228</a> </td> <td class="c3" > 181 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 251 </td> <td class="s"> $Text = join '', map { </td> </tr> <tr> <td class="h" > <a name="229">229</a> </td> <td class="c3" > 97 </td> <td >   </td> <td >   </td> <td class="c3" > <a href="lib-MKDoc-Text-Structured-Inline-pm--subroutine.html#229-1"> 97 </a> </td> <td >   </td> <td > 218 </td> <td class="s"> my $stuff = $_; </td> </tr> <tr> <td class="h" > <a name="230">230</a> </td> <td class="c3" > 181 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 575 </td> <td class="s"> $stuff = " $stuff "; </td> </tr> <tr> <td class="h" > <a name="231">231</a> </td> <td class="c3" > 181 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 508 </td> <td class="s"> while ($stuff =~ s/ </td> </tr> <tr> <td class="h" > <a name="232">232</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> (?<=(?:\s|\n)) # must start with space or carriage return </td> </tr> <tr> <td class="h" > <a name="233">233</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> \* # star </td> </tr> <tr> <td class="h" > <a name="234">234</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> (\S|\S.*?\S) # stuff to capture and emphasize </td> </tr> <tr> <td class="h" > <a name="235">235</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> \* # star </td> </tr> <tr> <td class="h" > <a name="236">236</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> (?=(?:<|\s|\n|\p{IsPunct}(?:\s|\n|<))) # must be followed by space, \n or (punctuation + space or \n) </td> </tr> <tr> <td class="h" > <a name="237">237</a> </td> <td class="c3" > 5 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 16 </td> <td class="s"> /_make_strong_wrap ($1)/xes) {} </td> </tr> <tr> <td class="h" > <a name="238">238</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> </td> </tr> <tr> <td class="h" > <a name="239">239</a> </td> <td class="c3" > 181 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 14605 </td> <td class="s"> $stuff =~ s/^ //; </td> </tr> <tr> <td class="h" > <a name="240">240</a> </td> <td class="c3" > 181 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 543 </td> <td class="s"> $stuff =~ s/ $//; </td> </tr> <tr> <td class="h" > <a name="241">241</a> </td> <td class="c3" > 181 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 582 </td> <td class="s"> $stuff; </td> </tr> <tr> <td class="h" > <a name="242">242</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } _tokenize ($Text); </td> </tr> <tr> <td class="h" > <a name="243">243</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="244">244</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="245">245</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="246">246</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub _make_strong_wrap </td> </tr> <tr> <td class="h" > <a name="247">247</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> { </td> </tr> <tr> <td class="h" > <a name="248">248</a> </td> <td class="c3" > 5 </td> <td >   </td> <td >   </td> <td class="c3" > <a href="lib-MKDoc-Text-Structured-Inline-pm--subroutine.html#248-1"> 5 </a> </td> <td >   </td> <td > 12 </td> <td class="s"> my $stuff = shift; </td> </tr> <tr> <td class="h" > <a name="249">249</a> </td> <td class="c3" > 5 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 12 </td> <td class="s"> local $Text = $stuff; </td> </tr> <tr> <td class="h" > <a name="250">250</a> </td> <td class="c3" > 5 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 26 </td> <td class="s"> _make_em ($Text); </td> </tr> <tr> <td class="h" > <a name="251">251</a> </td> <td class="c3" > 5 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 44 </td> <td class="s"> return "<strong>$Text</strong>"; </td> </tr> <tr> <td class="h" > <a name="252">252</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="253">253</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="254">254</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="255">255</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub _make_em </td> </tr> <tr> <td class="h" > <a name="256">256</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> { </td> </tr> <tr> <td class="h" > <a name="257">257</a> </td> <td class="c3" > 202 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 290 </td> <td class="s"> $Text = join '', map { </td> </tr> <tr> <td class="h" > <a name="258">258</a> </td> <td class="c3" > 98 </td> <td >   </td> <td >   </td> <td class="c3" > <a href="lib-MKDoc-Text-Structured-Inline-pm--subroutine.html#258-1"> 98 </a> </td> <td >   </td> <td > 258 </td> <td class="s"> my $stuff = $_; </td> </tr> <tr> <td class="h" > <a name="259">259</a> </td> <td class="c3" > 202 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 369 </td> <td class="s"> $stuff = " $stuff "; </td> </tr> <tr> <td class="h" > <a name="260">260</a> </td> <td class="c3" > 202 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 591 </td> <td class="s"> while ($stuff =~ s/ </td> </tr> <tr> <td class="h" > <a name="261">261</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> (?<=(?:\s|\n)) # must start with space or carriage return </td> </tr> <tr> <td class="h" > <a name="262">262</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> _ # underscore </td> </tr> <tr> <td class="h" > <a name="263">263</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> (\S|\S.*?\S) # stuff to capture and emphasize </td> </tr> <tr> <td class="h" > <a name="264">264</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> _ # underscore </td> </tr> <tr> <td class="h" > <a name="265">265</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> (?=(?:<|\s|\n|\p{IsPunct}(?:\s|\n))) # must be followed by space, \n or (punctuation + space or \n) </td> </tr> <tr> <td class="h" > <a name="266">266</a> </td> <td class="c3" > 4 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 12 </td> <td class="s"> /_make_em_wrap ($1)/xes) {} </td> </tr> <tr> <td class="h" > <a name="267">267</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="268">268</a> </td> <td class="c3" > 202 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 575 </td> <td class="s"> $stuff =~ s/^ //; </td> </tr> <tr> <td class="h" > <a name="269">269</a> </td> <td class="c3" > 202 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 568 </td> <td class="s"> $stuff =~ s/ $//; </td> </tr> <tr> <td class="h" > <a name="270">270</a> </td> <td class="c3" > 202 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 633 </td> <td class="s"> $stuff; </td> </tr> <tr> <td class="h" > <a name="271">271</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } _tokenize ($Text); </td> </tr> <tr> <td class="h" > <a name="272">272</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="273">273</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="274">274</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="275">275</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub _make_em_wrap </td> </tr> <tr> <td class="h" > <a name="276">276</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> { </td> </tr> <tr> <td class="h" > <a name="277">277</a> </td> <td class="c3" > 4 </td> <td >   </td> <td >   </td> <td class="c3" > <a href="lib-MKDoc-Text-Structured-Inline-pm--subroutine.html#277-1"> 4 </a> </td> <td >   </td> <td > 8 </td> <td class="s"> my $stuff = shift; </td> </tr> <tr> <td class="h" > <a name="278">278</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> </td> </tr> <tr> <td class="h" > <a name="279">279</a> </td> <td class="c3" > 4 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 7 </td> <td class="s"> local $Text = $stuff; </td> </tr> <tr> <td class="h" > <a name="280">280</a> </td> <td class="c3" > 4 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 17 </td> <td class="s"> _make_strong ($Text); </td> </tr> <tr> <td class="h" > <a name="281">281</a> </td> <td class="c3" > 4 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 26 </td> <td class="s"> return "<em>$Text</em>"; </td> </tr> <tr> <td class="h" > <a name="282">282</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="283">283</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="284">284</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="285">285</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub _make_smilies </td> </tr> <tr> <td class="h" > <a name="286">286</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> { </td> </tr> <tr> <td class="h" > <a name="287">287</a> </td> <td class="c3" > 213 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 287 </td> <td class="s"> $Text = join '', map { </td> </tr> <tr> <td class="h" > <a name="288">288</a> </td> <td class="c3" > 93 </td> <td >   </td> <td >   </td> <td class="c3" > <a href="lib-MKDoc-Text-Structured-Inline-pm--subroutine.html#288-1"> 93 </a> </td> <td >   </td> <td > 208 </td> <td class="s"> my $stuff = $_; </td> </tr> <tr> <td class="h" > <a name="289">289</a> </td> <td class="c3" > 213 </td> <td class="c3" > <a href="lib-MKDoc-Text-Structured-Inline-pm--branch.html#289-1"> 100 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 631 </td> <td class="s"> $stuff =~ s/:-\)/<span class="smiley-happy">:-)<\/span>/g unless ($stuff =~ /^</); </td> </tr> <tr> <td class="h" > <a name="290">290</a> </td> <td class="c3" > 213 </td> <td class="c3" > <a href="lib-MKDoc-Text-Structured-Inline-pm--branch.html#290-1"> 100 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 588 </td> <td class="s"> $stuff =~ s/:-\(/<span class="smiley-sad">:-(<\/span>/g unless ($stuff =~ /^</); </td> </tr> <tr> <td class="h" > <a name="291">291</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # don't do ;-) think about what happens with &-) </td> </tr> <tr> <td class="h" > <a name="292">292</a> </td> <td class="c3" > 213 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 488 </td> <td class="s"> $stuff; </td> </tr> <tr> <td class="h" > <a name="293">293</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } _tokenize ($Text); </td> </tr> <tr> <td class="h" > <a name="294">294</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="295">295</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="296">296</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="297">297</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub _break_long_words </td> </tr> <tr> <td class="h" > <a name="298">298</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> { </td> </tr> <tr> <td class="h" > <a name="299">299</a> </td> <td class="c3" > 241 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 332 </td> <td class="s"> $Text = join '', map { </td> </tr> <tr> <td class="h" > <a name="300">300</a> </td> <td class="c3" > 97 </td> <td >   </td> <td >   </td> <td class="c3" > <a href="lib-MKDoc-Text-Structured-Inline-pm--subroutine.html#300-1"> 97 </a> </td> <td >   </td> <td > 3678 </td> <td class="s"> my $stuff = $_; </td> </tr> <tr> <td class="h" > <a name="301">301</a> </td> <td class="c3" > 241 </td> <td class="c3" > <a href="lib-MKDoc-Text-Structured-Inline-pm--branch.html#301-1"> 100 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 4147 </td> <td class="s"> $stuff = _insert_spaces ($stuff, $LongestWord) unless ($stuff =~ /^</); </td> </tr> <tr> <td class="h" > <a name="302">302</a> </td> <td class="c3" > 241 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 631 </td> <td class="s"> $stuff; </td> </tr> <tr> <td class="h" > <a name="303">303</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } _tokenize ($Text); </td> </tr> <tr> <td class="h" > <a name="304">304</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="305">305</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="306">306</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="307">307</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub _insert_spaces </td> </tr> <tr> <td class="h" > <a name="308">308</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> { </td> </tr> <tr> <td class="h" > <a name="309">309</a> </td> <td class="c3" > 172 </td> <td >   </td> <td >   </td> <td class="c3" > <a href="lib-MKDoc-Text-Structured-Inline-pm--subroutine.html#309-1"> 172 </a> </td> <td >   </td> <td > 10365 </td> <td class="s"> my $text = shift; </td> </tr> <tr> <td class="h" > <a name="310">310</a> </td> <td class="c3" > 172 </td> <td >   </td> <td class="c3" > <a href="lib-MKDoc-Text-Structured-Inline-pm--condition.html#310-1"> 100 </a> </td> <td >   </td> <td >   </td> <td > 1270 </td> <td class="s"> my $length = shift || return $text; </td> </tr> <tr> <td class="h" > <a name="311">311</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # we can break continuous non-space text after "/", ";" or "-" </td> </tr> <tr> <td class="h" > <a name="312">312</a> </td> <td class="c3" > 169 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 1435 </td> <td class="s"> $text =~ s/(\S{$length}[\/;-])(?=\S)/$1 /g; </td> </tr> <tr> <td class="h" > <a name="313">313</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # we can break continuous non-space text so long as it doesn't contain an ampersand </td> </tr> <tr> <td class="h" > <a name="314">314</a> </td> <td class="c3" > 169 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 983 </td> <td class="s"> $text =~ s/([^[:space:]&]{$length})(?=\S)/$1 /g; </td> </tr> <tr> <td class="h" > <a name="315">315</a> </td> <td class="c3" > 169 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 475 </td> <td class="s"> return $text; </td> </tr> <tr> <td class="h" > <a name="316">316</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="317">317</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="318">318</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="319">319</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub _tokenize </td> </tr> <tr> <td class="h" > <a name="320">320</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> { </td> </tr> <tr> <td class="h" > <a name="321">321</a> </td> <td class="c3" > 575 </td> <td >   </td> <td >   </td> <td class="c3" > <a href="lib-MKDoc-Text-Structured-Inline-pm--subroutine.html#321-1"> 575 </a> </td> <td >   </td> <td > 822 </td> <td class="s"> my $text = shift; </td> </tr> <tr> <td class="h" > <a name="322">322</a> </td> <td class="c3" > 575 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 3544 </td> <td class="s"> my @res = $text =~ /([^<]+)|(<.+?>)/g; </td> </tr> <tr> <td class="h" > <a name="323">323</a> </td> <td class="c3" > 575 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 1130 </td> <td class="s"> return grep { defined $_ } @res; </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c3" > 2390 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 7510 </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="324">324</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="325">325</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="326">326</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="327">327</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> 1; </td> </tr> <tr> <td class="h" > <a name="328">328</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="329">329</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="330">330</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> __END__ </td> </tr> </table> </body> </html>