gohugoio / hugo

The world’s fastest framework for building websites.
https://gohugo.io
Apache License 2.0
76.1k stars 7.54k forks source link

Native support for the Pangu plugin #10617

Open cmpute opened 1 year ago

cmpute commented 1 year ago

I'm not sure if anybody has brought this up but I just wish this feature could be supported. Pangu is a module that automatically insert spaces between CJK characters and Latin characters, which is very useful to increase readability of some text mixed with CJK and Latin characters. It has been implemented in several languages including Go and JS.

This plugin has been widely used by blog themes, but they all rely on the javascript version. It makes sense to me to support it natively in Hugo, so that the process is done during building instead of browsing.

bep commented 1 year ago

@cmpute thanks for this. Realistically, I think this would need to be implemented in Goldmark. They already have a CJK extension (see https://github.com/gohugoio/hugo/issues/10472), but I'm not sure exactly what that does, but I would start there. The maintainer of Goldmark is very attentive and open to suggestions.

cmpute commented 1 year ago

Thank for the info, I posted a request in Goldmark: https://github.com/yuin/goldmark/discussions/351

cathaysia commented 1 year ago

native support this is not a good idea. pangu may insert some bad space around content.