You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MagicString's overwrite method would be used for this. Currently, I'm replacing by regex. Instead, I would need to get start and end indices for each match of regex.links.all and feed those to the overwrite method on a loop. Then, I could use toString on each call to getWordsFromIndex.
This library will outsource the complex link replacement code: https://github.com/rich-harris/magic-string
OR, I can just implement the right algorithm: walk the content backward so that I don't mess up "future" index values when replacing the links
The text was updated successfully, but these errors were encountered: