-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(renderer): render predefined attributes as HTML entities
includes `{nbps}`, etc. also, simplify rendering (no template needed) Fixes #953 Signed-off-by: Xavier Coulon <[email protected]>
- Loading branch information
Showing
11 changed files
with
43 additions
and
75 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,9 @@ | ||
package sgml | ||
|
||
import ( | ||
"strings" | ||
|
||
"github.com/bytesparadise/libasciidoc/pkg/types" | ||
"github.com/pkg/errors" | ||
) | ||
|
||
func (r *sgmlRenderer) renderPredefinedAttribute(a *types.PredefinedAttribute) (string, error) { | ||
result := &strings.Builder{} | ||
if err := r.predefinedAttribute.Execute(result, struct { | ||
Name string | ||
}{ | ||
Name: a.Name, | ||
}); err != nil { | ||
return "", errors.Wrap(err, "error while rendering predefined attribute") | ||
} | ||
// log.Debugf("rendered predefined attribute for '%s': '%s'", a.Name, result.String()) | ||
return result.String(), nil | ||
return predefinedAttribute(a.Name), nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package sgml_test | ||
|
||
import ( | ||
"testing" | ||
|
||
. "github.com/onsi/ginkgo" | ||
. "github.com/onsi/gomega" | ||
) | ||
|
||
func TestSgml(t *testing.T) { | ||
RegisterFailHandler(Fail) | ||
RunSpecs(t, "Sgml Suite") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters