Text / HTML strings and length?
-
Hi Eli –
I’m trying to select some content using the start/stop and the length variable. For example:
<p>As with other seafood, shrimp is high in <a href="/wiki/Calcium" title="Calcium">calcium</a>, <a href="/wiki/Iodine" title="Iodine">iodine</a> and <a href="/wiki/Protein" title="Protein">protein</a> but low in <a href="/wiki/Food_energy" title="Food energy">food energy</a>. A shrimp-based meal is also a significant source of <a href="/wiki/Cholesterol" title="Cholesterol">cholesterol</a>, from 122 <a href="/wiki/Milligram" title="Milligram">mg</a> to 251 mg per 100 <a href="/wiki/Gram" title="Gram">g</a> of shrimp, depending on the method of preparation.<sup id="cite_ref-3" class="reference"><a href="#cite_note-3"><span>[</span>3<span>]</span></a></sup> Shrimp consumption, however, is considered healthy for the circulatory system because the lack of significant levels of saturated fat in shrimp means that the high cholesterol content in shrimp actually improves the ratio of LDL to HDL cholesterol and lowers <a href="/wiki/Triglycerides" title="Triglycerides">triglycerides</a>.<sup id="cite_ref-4" class="reference"><a href="#cite_note-4"><span>[</span>4<span>]</span></a></sup></p> <p>Shrimp and other <a href="/wiki/Shellfish" title="Shellfish">shellfish</a> are among the most common <a href="/wiki/Food_allergy" title="Food allergy">food allergens</a>.<sup id="cite_ref-5" class="reference"><a href="#cite_note-5"><span>[</span>5<span>]</span></a></sup> They are not <a href="/wiki/Kosher" title="Kosher">kosher</a> and thus are forbidden in <a href="/wiki/Jewish_cuisine" title="Jewish cuisine">Jewish cuisine</a>. Shrimp are <a href="/wiki/Halal" title="Halal">halal</a> according to some <a href="/wiki/Madh%C4%81hib" title="Madhāhib">madhāhib</a>, and therefore <a href="/wiki/Comparison_of_Islamic_and_Jewish_dietary_laws#Similarities" title="Comparison of Islamic and Jewish dietary laws">permissible to most</a>, but not all, <a href="/wiki/Muslim" title="Muslim">Muslims</a>.</p> <div style="clear:both;"></div> <p> <strong class="error mw-ext-cite-error">Cite error: There are <code><ref></code> tags on this page, but the references will not show without a <code>{{reflist}}</code> template (see the <a href="Cite_errors/Cite_error_refs_without_references" title="Help:Cite errors/Cite error refs without references">help page</a>).</p> from http://en.wikipedia.org/w/api.php?action=parse&page=Shrimp&format=txt&prop=text§ion=13If I use start='<p>As with ‘ stop=’ms. ‘ length=”-8″ I would hope to end up with text as follows:
As with other seafood, shrimp…. …..permissible to most, but not all,
<a href="/wiki/Muslim" title="Muslim">Muslims.But while the start -8 is perfect, the stop doesn’t stop after the given stop data and continues to the end of the entire chosen selection – it’s as though the stop isn’t being seen.
The error message seems to imply the same:
SHORTCURL stop=ms</a>. but not found in(http://en.wikipedia.org/w/api.php?action=parse&page=Shrimp&format=txt&prop=text§ion=13)!but when I open the array, the string is clearly there…
Would appreciate any suggestions you might have thx.
The topic ‘Text / HTML strings and length?’ is closed to new replies.