I am experiencing an issue in ERPNext/Frappe v15 where URLs containing query parameters are incorrectly converted into divided hyperlinks by rich-text editor fields.
Environment
-
Frappe Framework: v15.101.5
-
ERPNext: v15.100.1
-
Browser: Google Chrome 150.0.7871.187, 64-bit
-
Operating system: Windows 10
Example URL
The issue can be reproduced using this nonfunctional example URL:
https://example.com?invid=TEST123456
Actual behavior
When the URL is pasted into a rich-text editor field, only the portion before the question mark becomes part of the hyperlink:
https://example.com
The following portion is displayed as plain text immediately after the hyperlink:
?invid=TEST123456
The result appears visually as one continuous URL, but the actual hyperlink points only to:
https://example.com
The query parameter is excluded from the hyperlink.
Steps to reproduce
-
Open any ERPNext or Frappe field that uses the rich-text editor.
-
Paste the following URL:
https://example.com?invid=TEST123456
-
Observe that only
https://example.combecomes a hyperlink. -
The text
?invid=TEST123456remains outside the hyperlink.
The same behavior occurs when using Paste as plain text:
-
Paste the URL as plain text into the rich-text editor.
-
Initially, the entire URL remains plain text.
-
Press the Return or Enter key.
-
The editor automatically converts the URL into a hyperlink.
-
The hyperlink is again divided at the question mark.
Email Template behavior
The problem is not limited to URLs manually pasted into an outgoing email.
When an Email Template inserts a URL containing a query parameter, the generated email also contains the divided hyperlink.
If the email is sent from ERPNext, the divided hyperlink remains incorrect and nonfunctional for the recipient. Only the portion before the question mark is clickable.
Expected behavior
The rich-text editor should recognize the entire URL, including its query string, as one hyperlink:
https://example.com?invid=TEST123456
The hyperlink destination should include:
?invid=TEST123456
Additional information
The same URL is converted correctly when pasted into Microsoft Word or Gmail.
This issue affects payment links and potentially any URL that depends on query parameters. In our case, the omitted query parameter identifies the specific payment request, so excluding it makes the resulting hyperlink unusable.
Has anyone else encountered this behavior in Frappe or ERPNext v15? Is this a known rich-text editor issue, or is there a configuration or sanitization setting that controls URL detection?