From 829a934d23ab221049b4d54926305d8d5d64c9ad Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Sat, 13 Nov 2021 12:29:08 +0100 Subject: update dependencies (#296) --- .../microcosm-cc/bluemonday/.editorconfig | 4 ++ .../microcosm-cc/bluemonday/.gitattributes | 1 + .../github.com/microcosm-cc/bluemonday/CREDITS.md | 3 +- vendor/github.com/microcosm-cc/bluemonday/Makefile | 8 ++- .../github.com/microcosm-cc/bluemonday/README.md | 6 ++- .../github.com/microcosm-cc/bluemonday/policy.go | 30 ++++++++++++ .../github.com/microcosm-cc/bluemonday/sanitize.go | 57 +++++++++++++++++++--- .../bluemonday/stringwriterwriter_go1.12.go | 1 + .../bluemonday/stringwriterwriter_ltgo1.12.go | 1 + 9 files changed, 99 insertions(+), 12 deletions(-) create mode 100644 vendor/github.com/microcosm-cc/bluemonday/.editorconfig create mode 100644 vendor/github.com/microcosm-cc/bluemonday/.gitattributes (limited to 'vendor/github.com/microcosm-cc') diff --git a/vendor/github.com/microcosm-cc/bluemonday/.editorconfig b/vendor/github.com/microcosm-cc/bluemonday/.editorconfig new file mode 100644 index 000000000..006bc2fc7 --- /dev/null +++ b/vendor/github.com/microcosm-cc/bluemonday/.editorconfig @@ -0,0 +1,4 @@ +root = true + +[*] +end_of_line = lf diff --git a/vendor/github.com/microcosm-cc/bluemonday/.gitattributes b/vendor/github.com/microcosm-cc/bluemonday/.gitattributes new file mode 100644 index 000000000..6313b56c5 --- /dev/null +++ b/vendor/github.com/microcosm-cc/bluemonday/.gitattributes @@ -0,0 +1 @@ +* text=auto eol=lf diff --git a/vendor/github.com/microcosm-cc/bluemonday/CREDITS.md b/vendor/github.com/microcosm-cc/bluemonday/CREDITS.md index b3185f543..68fa88da8 100644 --- a/vendor/github.com/microcosm-cc/bluemonday/CREDITS.md +++ b/vendor/github.com/microcosm-cc/bluemonday/CREDITS.md @@ -4,4 +4,5 @@ 1. Andrew Krasichkov @buglloc https://github.com/buglloc 1. Mike Samuel mikesamuel@gmail.com 1. Dmitri Shuralyov shurcooL@gmail.com -1. https://github.com/opennota \ No newline at end of file +1. opennota https://github.com/opennota https://gitlab.com/opennota +1. Tom Anthony https://www.tomanthony.co.uk/ \ No newline at end of file diff --git a/vendor/github.com/microcosm-cc/bluemonday/Makefile b/vendor/github.com/microcosm-cc/bluemonday/Makefile index b5903a2e8..dcd042a71 100644 --- a/vendor/github.com/microcosm-cc/bluemonday/Makefile +++ b/vendor/github.com/microcosm-cc/bluemonday/Makefile @@ -3,6 +3,7 @@ # all: Builds the code locally after testing # # fmt: Formats the source files +# fmt-check: Check if the source files are formated # build: Builds the code locally # vet: Vets the code # lint: Runs lint over the code (you do not need to fix everything) @@ -11,6 +12,8 @@ # # install: Builds, tests and installs the code locally +GOFILES_NOVENDOR = $(shell find . -type f -name '*.go' -not -path "./vendor/*" -not -path "./.git/*") + .PHONY: all fmt build vet lint test cover install # The first target is always the default action if `make` is called without @@ -19,7 +22,10 @@ all: fmt vet test install fmt: - @gofmt -s -w ./$* + @gofmt -s -w ${GOFILES_NOVENDOR} + +fmt-check: + @([ -z "$(shell gofmt -d $(GOFILES_NOVENDOR) | head)" ]) || (echo "Source is unformatted"; exit 1) build: @go build diff --git a/vendor/github.com/microcosm-cc/bluemonday/README.md b/vendor/github.com/microcosm-cc/bluemonday/README.md index 6a34473ef..d20debf0e 100644 --- a/vendor/github.com/microcosm-cc/bluemonday/README.md +++ b/vendor/github.com/microcosm-cc/bluemonday/README.md @@ -180,7 +180,7 @@ p.AllowElementsMatching(regex.MustCompile(`^my-element-`)) Or add elements as a virtue of adding an attribute: ```go -// Not the recommended pattern, see the recommendation on using .Matching() below +// Note the recommended pattern, see the recommendation on using .Matching() below p.AllowAttrs("nowrap").OnElements("td", "th") ``` @@ -222,7 +222,7 @@ p.AllowElements("fieldset", "select", "option") Although it's possible to handle inline CSS using `AllowAttrs` with a `Matching` rule, writing a single monolithic regular expression to safely process all inline CSS which you wish to allow is not a trivial task. Instead of attempting to do so, you can allow the `style` attribute on whichever element(s) you desire and use style policies to control and sanitize inline styles. -It is suggested that you use `Matching` (with a suitable regular expression) +It is strongly recommended that you use `Matching` (with a suitable regular expression) `MatchingEnum`, or `MatchingHandler` to ensure each style matches your needs, but default handlers are supplied for most widely used styles. @@ -379,6 +379,8 @@ Both examples exhibit the same issue, they declare attributes but do not then sp We are not yet including any tools to help allow and sanitize CSS. Which means that unless you wish to do the heavy lifting in a single regular expression (inadvisable), **you should not allow the "style" attribute anywhere**. +In the same theme, both `