Problem
assumes the search fragment exists in the source string.
When it does not, returns and the current implementation can return a corrupted string.
Impact
- index updates can become fragile in unexpected HTML structures
- id or full-name rewriting may produce broken markup instead of leaving the string unchanged
Expected behavior
If the search fragment is not found, the function should return the original string unchanged.
Problem
assumes the search fragment exists in the source string.
When it does not, returns and the current implementation can return a corrupted string.
Impact
Expected behavior
If the search fragment is not found, the function should return the original string unchanged.