morbac / xmltools

XML Tools plugin for Notepad++
GNU General Public License v3.0
260 stars 57 forks source link

crash pretty printing some XML #124

Closed NSoiffer closed 2 years ago

NSoiffer commented 2 years ago

In Notepad++ v8.1.5 (32 bit)

Trying to pretty print or linearize the following (only thing in the file) triggers a PluginsManager::runPluginCommand Exception

[Update]: just spotted the problem: <mo)</mo> -- bad syntax shouldn't cause an exception

 <math>
  <msub>
    <mi></mi>
    <mi>p</mi>
  </msub>
  <mo>&#x2062;</mo>
  <mrow>
    <mmultiscripts>
      <mi>F</mi>
      <mi>q</mi>
      <none/>
      <mprescripts/>
      <mi>p</mi>
      <none/>
    </mmultiscripts>
    <mo>&#x2061;</mo>
    <mrow>
      <mo>(</mo>
      <mrow>
        <msub>
          <mi>a</mi>
          <mn>1</mn>
        </msub>
        <mo>,</mo>
        <mo>.</mo>
        <mo>.</mo>
        <mo>.</mo>
        <mo>,</mo>
        <msub>
          <mi>a</mi>
          <mi>p</mi>
        </msub>
        <mo>;</mo>
        <msub>
          <mi>b</mi>
          <mn>1</mn>
        </msub>
        <mo>,</mo>
        <mo>.</mo>
        <mo>.</mo>
        <mo>.</mo>
        <mo>,</mo>
        <msub>
          <mi>b</mi>
          <mi>q</mi>
        </msub>
        <mo>;</mo>
        <mi>z</mi>
      </mrow>
      <mo)</mo>
    </mrow>
  </mrow>
</math>
morbac commented 2 years ago

I guess you're using SimpleXml pretty print engine. Go in menu "Plugins > XML Tools > Options..." and select "QuickXml" as "Formating engine" in "Pretty print options" group