svn commit: r562416 - in head/www/gohugo: . files
Fernando Apesteguía
fernape at FreeBSD.org
Sat Jan 23 19:37:59 UTC 2021
Author: fernape
Date: Sat Jan 23 19:37:58 2021
New Revision: 562416
URL: https://svnweb.freebsd.org/changeset/ports/562416
Log:
www/gohugo: Allow arbitrary Asciidoc extension in unsafe mode
Include change from this pull request[1] as per carlavilla@ request.
This allows us to build the new documentation and website without having to
create custom scripts.
Maintainer notified via e-mail.
[1] https://github.com/gohugoio/hugo/pull/8131/files
Added:
head/www/gohugo/files/
head/www/gohugo/files/patch-markup_asciidocext_convert.go (contents, props changed)
head/www/gohugo/files/patch-markup_asciidocext_convert__test.go (contents, props changed)
Modified:
head/www/gohugo/Makefile
Modified: head/www/gohugo/Makefile
==============================================================================
--- head/www/gohugo/Makefile Sat Jan 23 19:35:57 2021 (r562415)
+++ head/www/gohugo/Makefile Sat Jan 23 19:37:58 2021 (r562416)
@@ -3,6 +3,7 @@
PORTNAME= hugo
DISTVERSIONPREFIX= v
DISTVERSION= 0.80.0
+PORTREVISION= 1
CATEGORIES= www
PKGNAMEPREFIX= go
DIST_SUBDIR= ${PKGNAMEPREFIX}${PORTNAME}
Added: head/www/gohugo/files/patch-markup_asciidocext_convert.go
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/www/gohugo/files/patch-markup_asciidocext_convert.go Sat Jan 23 19:37:58 2021 (r562416)
@@ -0,0 +1,11 @@
+--- markup/asciidocext/convert.go.orig 2021-01-23 16:42:36 UTC
++++ markup/asciidocext/convert.go
+@@ -105,7 +105,7 @@ func (a *asciidocConverter) parseArgs(ctx converter.Do
+ args = a.appendArg(args, "-b", cfg.Backend, asciidocext_config.CliDefault.Backend, asciidocext_config.AllowedBackend)
+
+ for _, extension := range cfg.Extensions {
+- if !asciidocext_config.AllowedExtensions[extension] {
++ if cfg.SafeMode != "unsafe" && !asciidocext_config.AllowedExtensions[extension] {
+ a.cfg.Logger.Errorln("Unsupported asciidoctor extension was passed in. Extension `" + extension + "` ignored.")
+ continue
+ }
Added: head/www/gohugo/files/patch-markup_asciidocext_convert__test.go
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/www/gohugo/files/patch-markup_asciidocext_convert__test.go Sat Jan 23 19:37:58 2021 (r562416)
@@ -0,0 +1,34 @@
+--- markup/asciidocext/convert_test.go.orig 2021-01-23 16:44:14 UTC
++++ markup/asciidocext/convert_test.go
+@@ -115,6 +115,31 @@ func TestAsciidoctorDisallowedArgs(t *testing.T) {
+ c.Assert(args, qt.DeepEquals, expected)
+ }
+
++func TestAsciidoctorArbitraryExtension(t *testing.T) {
++ c := qt.New(t)
++ cfg := viper.New()
++ mconf := markup_config.Default
++ mconf.AsciidocExt.Extensions = []string{"arbitrary-extension"}
++ p, err := Provider.New(
++ converter.ProviderConfig{
++ Cfg: cfg,
++ MarkupConfig: mconf,
++ Logger: loggers.NewErrorLogger(),
++ },
++ )
++ c.Assert(err, qt.IsNil)
++
++ conv, err := p.New(converter.DocumentContext{})
++ c.Assert(err, qt.IsNil)
++
++ ac := conv.(*asciidocConverter)
++ c.Assert(ac, qt.Not(qt.IsNil))
++
++ args := ac.parseArgs(converter.DocumentContext{})
++ expected := []string{"-r", "arbitrary-extension", "--no-header-footer"}
++ c.Assert(args, qt.DeepEquals, expected)
++}
++
+ func TestAsciidoctorDiagramArgs(t *testing.T) {
+ c := qt.New(t)
+ cfg := viper.New()
More information about the svn-ports-all
mailing list