ractivejs / ractive

Next-generation DOM manipulation
http://ractive.js.org
MIT License
5.94k stars 396 forks source link

Ractive.js: Could not parse partial from expression #3321

Closed TanvirAlam closed 4 years ago

TanvirAlam commented 4 years ago

Description:

Ractive.js: Could not parse partial from expression '<table>  <tr>    <td valign="top">      <b>        <i>Merk:</i>      </b>    </td>    <td valign="top">Bruk hvis mulig tilleggskode (U82-U85) for å angi resistens mot antimikrobielle og antineoplastiske medikamenter.</td>  </tr></table>
<p>  <div>    <b>Kategoriblokker</b>  </div>  <table>    <tr>      <td VALIGN="top" nowrap="">        <a href="#A00">A00</a>-A09</td>      <td valign="top">Infeksiøse tarmsykdommer</td>    </tr>    <tr>      <td VALIGN="top" nowrap="">        <a href="#A15">A15</a>-A19</td>      <td valign="top">Tuberkulose</td>    </tr>    <tr>      <td VALIGN="top" nowrap="">        <a href="#A20">A20</a>-A28</td>      <td valign="top">Visse bakterielle zoonoser</td>    </tr>    <tr>      <td VALIGN="top" nowrap="">        <a href="#A30">A30</a>-A49</td>      <td valign="top">Andre bakteriesykdommer</td>    </tr>    <tr>      <td VALIGN="top" nowrap="">        <a href="#A50">A50</a>-A64</td>      <td valign="top">Hovedsakelig seksuelt overførbare infeksjoner</td>    </tr>    <tr>      <td VALIGN="top" nowrap="">        <a href="#A65">A65</a>-A69</td>      <td valign="top">Andre spiroketsykdommer</td>    </tr>    <tr>      <td VALIGN="top" nowrap="">        <a href="#A70">A70</a>-A74</td>      <td valign="top">Andre sykdommer forårsaket av klamydia</td>    </tr>    <tr>      <td VALIGN="top" nowrap="">        <a href="#A75">A75</a>-A79</td>      <td valign="top">Rickettsioser</td>    </tr>    <tr>      <td VALIGN="top" nowrap="">        <a href="#A80">A80</a>-A89</td>      <td valign="top">Virusinfeksjoner i sentralnervesystemet</td>    </tr>    <tr>      <td VALIGN="top" nowrap="">        <a href="#A92">A92</a>-A99</td>      <td valign="top">Virussykdommer overført ved artropoder og viral hemoragisk feber</td>    </tr>    <tr>      <td VALIGN="top" nowrap="">        <a href="#B00">B00</a>-B09</td>      <td valign="top">Virusinfeksjoner kjennetegnet ved hud- og slimhinnelesjoner</td>    </tr>    <tr>      <td VALIGN="top" nowrap="">        <a href="#B15">B15</a>-B19</td>      <td valign="top">Virushepatitt</td>    </tr>    <tr>      <td VALIGN="top" nowrap="">        <a href="#B20">B20</a>-B24</td>      <td valign="top">Humant immunsviktvirus-sykdom</td>    </tr>    <tr>      <td VALIGN="top" nowrap="">        <a href="#B25">B25</a>-B34</td>      <td valign="top">Andre virussykdommer</td>    </tr>    <tr>      <td VALIGN="top" nowrap="">        <a href="#B35">B35</a>-B49</td>      <td valign="top">Soppsykdommer</td>    </tr>    <tr>      <td VALIGN="top" nowrap="">        <a href="#B50">B50</a>-B64</td>      <td valign="top">Protozosykdommer</td>    </tr>    <tr>      <td VALIGN="top" nowrap="">        <a href="#B65">B65</a>-B83</td>      <td valign="top">Helmintoser</td>    </tr>    <tr>      <td VALIGN="top" nowrap="">        <a href="#B85">B85</a>-B89</td>      <td valign="top">Infestasjon av lus, midd og andre ektoparasitter</td>    </tr>    <tr>      <td VALIGN="top" nowrap="">        <a href="#B90">B90</a>-B94</td>      <td valign="top">Følgetilstander etter infeksjonssykdommer og parasittsykdommer</td>    </tr>    <tr>      <td VALIGN="top" nowrap="">        <a href="#B95">B95</a>-B98</td>      <td valign="top">Bakterier, virus og andre infeksjonsfremkallende mikroorganismer</td>    </tr>    <tr>      <td VALIGN="top" nowrap="">        <a href="#B99">B99</a>      </td>      <td valign="top">Andre infeksjonssykdommer</td>    </tr>  </table></p>'Unexpected template content at line 122 character 1:</p>^----

In the view I am declaring it {{>{ template: value }}}

Please help anyone

Versions affected:

ractive.1.2.4

giovannipiller commented 4 years ago

Looks like you have a <div> within a <p>, which is not allowed. You can check this out on a simple example: https://jsfiddle.net/Lek0fva3/ (open the console to see the error)


As a suggestion, the next time you're dealing with parser issues, try to isolate the issue by slowly removing chunks of your code until it's simple enough.

You can then use JSFiddle or Ractive playground to provide a test case with an issue.

TanvirAlam commented 4 years ago

@giovannipiller thank you for your reply, yes I agree with you. I will try to replace all <p> with <div>, that is my best solution