gsdriver / ssml-check-core

Core SDK for ssml-check
MIT License
13 stars 10 forks source link

Any way to get error position ? #17

Closed CharlieEtienne closed 1 year ago

CharlieEtienne commented 1 year ago

Hi,

Firstly thank you for this package!

Is there any way to get the position of each error in the returned array?

Currently I have to search the whole text for a specific tag, then attributes, and then values to accomplish that.

Regards

gsdriver commented 1 year ago

Glad you found this useful! I just published a new version 0.3.6, which allows you to pass in a new "getPositions" field within the options structure. When set, a "position" field will be set for each returned error, which is the position of the error within the input string