Skip to content

Commit b83a36b

Browse files
committed
in subscription popup, fix showing text that has non-ascii
or actually when it switches unicode scripts, but details... reported by emicklei, thanks!
1 parent ab51767 commit b83a36b

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

Makefile

-1
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,3 @@ jsinstall0:
3636
fmt:
3737
go fmt ./...
3838
gofmt -w -s *.go
39-

index.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1006,7 +1006,9 @@ const subscriptionPopup = (sub, subscriptions, render) => {
10061006
dom._kids(modulegomod, dom.label('Contents of go.mod', gomod = dom.textarea(attr.required(''), attr.rows('12'))), dom.div(dom._class('explain'), 'Paste the contents of your go.mod. Subscriptions will be created for all direct dependencies.'), dom.label(indirect = dom.input(attr.type('checkbox')), ' Also subscribe to indirect dependencies'), dom.br());
10071007
dom._kids(submitbtn, 'Add subscriptions for dependencies');
10081008
}),
1009-
]), dom.div(module = dom.input(attr.required(''), attr.value(sub.Module)), dom.div(dom._class('explain'), 'Enter a single module as you would use in a Go import statement.', dom.br(), 'Example: github.com/mjl-/gopherwatch, github.com/mjl- or golang.org.'))), dom.br(), dom.b('Notify about ...'), dom.label(belowModule = dom.input(attr.type('checkbox'), sub.BelowModule ? attr.checked('') : []), ' ', dom.span('Sub modules', attr.title('E.g. if subscribed to github.com/mjl-, whether to match github.com/mjl-/gopherwatch.'))), dom.label(olderVersions = dom.input(attr.type('checkbox'), sub.OlderVersions ? attr.checked('') : []), ' ', dom.span('Older versions than already seen', attr.title('Can happen when an old version (tag) is requested through the Go module proxy after a later tag, not uncommon after forking a repository and pushing all historic tags.'))), dom.label(prerelease = dom.input(attr.type('checkbox'), sub.Prerelease ? attr.checked('') : []), ' Prereleases such as v1.2.3-beta1'), dom.label(pseudo = dom.input(attr.type('checkbox'), sub.Pseudo ? attr.checked('') : []), ' Pseudo versions, such as v0.0.0-20240222094833-a1bd684a916b'), dom.br(), dom.label('Comment', comment = dom.textarea(sub.Comment)), dom.br(), dom.div(submitbtn = dom.submitbutton(sub.ID ? 'Save subscription' : 'Add subscription')))));
1009+
]), dom.div(module = dom.input(attr.required(''), attr.value(sub.Module)), dom.div(dom._class('explain'), 'Enter a single module as you would use in a Go import statement.', dom.br(), 'Example: github.com/mjl-/gopherwatch, github.com/mjl- or golang.org.'))), dom.br(), dom.b('Notify about ...'), dom.label(belowModule = dom.input(attr.type('checkbox'), sub.BelowModule ? attr.checked('') : []), ' ', dom.span('Sub modules', attr.title('E.g. if subscribed to github.com/mjl-, whether to match github.com/mjl-/gopherwatch.'))), dom.label(olderVersions = dom.input(attr.type('checkbox'), sub.OlderVersions ? attr.checked('') : []), ' ', dom.span('Older versions than already seen', attr.title('Can happen when an old version (tag) is requested through the Go module proxy after a later tag, not uncommon after forking a repository and pushing all historic tags.'))), dom.label(prerelease = dom.input(attr.type('checkbox'), sub.Prerelease ? attr.checked('') : []), ' Prereleases such as v1.2.3-beta1'), dom.label(pseudo = dom.input(attr.type('checkbox'), sub.Pseudo ? attr.checked('') : []), ' Pseudo versions, such as v0.0.0-20240222094833-a1bd684a916b'), dom.br(), dom.label('Comment',
1010+
// explicit String to prevent special scriptswitch handling
1011+
comment = dom.textarea(new String(sub.Comment))), dom.br(), dom.div(submitbtn = dom.submitbutton(sub.ID ? 'Save subscription' : 'Add subscription')))));
10101012
module.focus();
10111013
};
10121014
const overview = async () => {

index.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,8 @@ const subscriptionPopup = (sub: api.Subscription, subscriptions: api.Subscriptio
293293
dom.br(),
294294
dom.label(
295295
'Comment',
296-
comment=dom.textarea(sub.Comment),
296+
// explicit String to prevent special scriptswitch handling
297+
comment=dom.textarea(new String(sub.Comment)),
297298
),
298299
dom.br(),
299300
dom.div(submitbtn=dom.submitbutton(sub.ID ? 'Save subscription' : 'Add subscription')),

0 commit comments

Comments
 (0)