~netlandish/links-dev

links: Strip leading pound (hash) symbols in tag names. v1 APPLIED

Peter Sanchez: 1
 Strip leading pound (hash) symbols in tag names.

 1 files changed, 4 insertions(+), 0 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.code.netlandish.com/~netlandish/links-dev/patches/150/mbox | git am -3
Learn more about email & git

[PATCH links] Strip leading pound (hash) symbols in tag names. Export this patch

Changelog-changed: No more leading hash marks in tag names
---
 helpers.go | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/helpers.go b/helpers.go
index 7d30e3f..53dd36f 100644
--- a/helpers.go
+++ b/helpers.go
@@ -745,6 +745,10 @@ func ProcessTags(ctx context.Context, tags []string) ([]int, error) {
	tagIDs := make([]int, 0)
	for _, tag := range tags {
		tag := strings.TrimSpace(tag)
		if strings.HasPrefix(tag, "#") {
			// Remove any leading hash mark
			tag = tag[1:]
		}
		if tag != "" {
			slug := Slugify(tag)
			if len(tag) > 50 || len(slug) > 50 {
-- 
2.47.2
Applied.

To git@git.code.netlandish.com:~netlandish/links
   9ed99a4..3aff1c0  master -> master