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
{{ message }}
This repository has been archived by the owner on Aug 5, 2020. It is now read-only.
descript.replace does not replace text across multiple inline scripts. This is a safety guard that is implemented in the descript replace function. We want to ensure there is no un-intentional inline script replacement. However, sometime we do need intentional replacement across multiple inline scripts.
For example, there are 2 scripts that contains an ID you need to replace:
<script>
...
var ID="123456789";
var sID="123456789";
....
</script>...<script>
...
varmob_ID="123456789"vartab_ID="123456789"...
</script>
The following line will only replace all instance of the text of the second script and not the first script because descript works in reverse order.
@Helen-Mobify we won't really have the bandwidth to add this feature in the mid-term, but if you open a PR with the change, we can merge it in. Thanks!
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
descript.replace
does not replace text across multiple inline scripts. This is a safety guard that is implemented in the descript replace function. We want to ensure there is no un-intentional inline script replacement. However, sometime we do need intentional replacement across multiple inline scripts.For example, there are 2 scripts that contains an ID you need to replace:
The following line will only replace all instance of the text of the second script and not the first script because descript works in reverse order.
The text was updated successfully, but these errors were encountered: