Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/tools/present: ActivityPub (e.g. Mastodon) handles are parsed as Twitter usernames #57982

Open
tuckerman opened this issue Jan 25, 2023 · 1 comment
Labels
FeatureRequest NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@tuckerman
Copy link

What version of Go are you using (go version)?

$ go version
go version go1.19.3 darwin/arm64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE=""
GOARCH="arm64"
GOBIN=""
GOCACHE="/Users/tuckerman/Library/Caches/go-build"
GOENV="/Users/tuckerman/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="arm64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/tuckerman/dev/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/tuckerman/dev"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/opt/homebrew/Cellar/go/1.19.3/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/opt/homebrew/Cellar/go/1.19.3/libexec/pkg/tool/darwin_arm64"
GOVCS=""
GOVERSION="go1.19.3"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/dev/null"
GOWORK=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/wk/hh1ylh7j72j18222jytym8lm0000gn/T/go-build90477944=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

Created a slide file, e.g.

# Example Title

Cameron Tuckerman-Lee
Bug Reporter
@tuckerman@hachyderm.io

## Foo
Bar
...

and ran present

What did you expect to see?

Ideally, the author details page would make "@tuckerman@hachyderm.io" a hyperlink to https://hachyderm.io/@tuckerman or not hyperlinked at all.

What did you see instead?

It links to http://twitter.com/tuckerman@hachyderm.io

Thoughts

Technically converting @foo@example.com into a URI requires a WebFinger lookup but, in the spirit of keeping the present tool simple, it seems reasonable to a) check strings.Contains(text[1:], "@") and just not hyperlink it to Twitter or b) make the same check, split on the second "@" and hyperlink it to "https://"+components[1]+"/@"+components[0].

I'd personally find the latter convenient as it seems the ability to host an activitypub server on a different domain than the one in the handle using WebFinger isn't very popular. I can understand not wanting to do something technically incorrect in an official package, in which case I'd still prefer not auto-hyperlinking to Twitter (I think doing any WebFinger lookups is far beyond the expected scope of present).

I have changes for either option locally if folks would be open to making this change.

@gopherbot gopherbot added the Tools This label describes issues relating to any tools in the x/tools repository. label Jan 25, 2023
@gopherbot gopherbot added this to the Unreleased milestone Jan 25, 2023
@mknyszek mknyszek added FeatureRequest NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Jan 30, 2023
@mknyszek
Copy link
Contributor

CC @rsc via https://dev.golang.org/owners

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FeatureRequest NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

3 participants