maugenst / tabletojson

An npm module for node.js to convert HTML tables to JSON objects
https://www.npmjs.com/package/tabletojson
MIT License
138 stars 38 forks source link

{ stripHtmlFromCells: false } still stripping html #84

Closed edisoncpp closed 1 year ago

edisoncpp commented 1 year ago
const rawJson = HtmlTableToJson.parse(html, {
      stripHtmlFromCells: false,
      ignoreColumns: [0]
    });

Where it contains:

<td class="a_title">
        <div>
          <span class="a_label">TITLE:</span>
            <span class="a_data">
               <a class="a-primary-color"
              href="/url/path?id=123">A link label here</a>
            </span>
        </div>
      </td>

I need to get to the href's id within the link but even with the stripHtmlFromCells flag set to false it strips it down to just text.

edisoncpp commented 1 year ago

Please delete, posted to the wrong place.