Closed sangeetk closed 5 years ago
Hi,
Would you take a look at: https://github.com/ponzu-cms/ponzu/blob/52226ad2351dd2d3bd4191c1d9cb7cc43939a8d7/system/item/item.go#L316
It may contain the conversion you mention. We use this mainly to keep the slug URL-friendly.
Hi nilslice,
I understand and it makes perfect sense to replace these characters while generating the slug, but for me they are even replaced from the other fields of the content that uses richtext editor, for eg the body section of a blog. Is there any other similar function that is called for user-defined fields ?
Regards, Sangeet
I'll take a look tonight to see if I can find out.
@nanohard @sangeetk - while we're looking at this, if anyone would like to, we could benefit from a PR that makes the calls to MustCompile
once in an init
func within this file and then appends a slice of the regex's returned for the stringToSlug
func to iterate through.
Currently, each MustCompile
call is needlessly made each invocation.
It's happening here:
cmd/ponzu/vendor/github.com/ponzu-cms/ponzu/system/admin/static/common/js/util.js:12
Will see what happens when I remove that line; might take a few days to test and push PR.
@sangeetk If you can remove that line and report back, even better.
Seems to be saving and loading okay via the backend GUI. If that's enough proof, I'll PR at request.
Hi,
I am finding lots of difficulties in inserting em-dash character into the body section of a blog which uses richtext editor. Both em dash and en dash characters are replaced by hyphen character after save. I think there is some function (either Go or JS) that does this conversion, which I couldn't find it out. Any help is highly appreciated.
Thanks, Sangeet