Escape the backslash in the string (#15232)
This ensures it's rendered in the pattern regex field in the browser. Without "\\w" -> "\w" we get "\w" ->"w" and only urls starting with www are accepted by the matcher.
This commit is contained in:
parent
1458b3ef56
commit
277adbed8e
1 changed files with 1 additions and 1 deletions
|
|
@ -5,7 +5,7 @@
|
|||
</div>
|
||||
<div class="form-group">
|
||||
<%= form.label :url %>
|
||||
<%= form.text_field :url, class: "form-control", pattern: "^(https?:\/\/|\/)\w+\.[^\s]+$|^\/[^\s]*$", title: "The URL can be absolute by beginning with http/s or it can be relative beginning with a /", required: true %>
|
||||
<%= form.text_field :url, class: "form-control", pattern: "^(https?:\/\/|\/)\\w+\.[^\s]+$|^\/[^\s]*$", title: "The URL can be absolute by beginning with http/s or it can be relative beginning with a /", required: true %>
|
||||
<div class="alert alert-info">A full (external) or relative (internal) URL for the link</div>
|
||||
</div>
|
||||
<div class="form-group" data-controller="svg-icon-upload">
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue