File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -265,13 +265,18 @@ def get_project(projects):
265265# =====================================================================
266266
267267# 1. Inject front-end fallback scripts early in HTML <head> for Chinese localization.
268- # This bypasses the Sphinx 9+ 'ChineseStemmer is not defined ' runtime crash.
268+ # This bypasses the Sphinx 9+ 'stemmer.stemWord is not a function ' runtime crash.
269269html_context = {}
270270if docset == "zh" :
271271 html_context ["metatags" ] = """
272272 <script>
273273 if (typeof Stemmer === 'undefined') {
274- window.Stemmer = function() { return { stem: function(w){return w;} }; };
274+ window.Stemmer = function() {
275+ return {
276+ stem: function(w){ return w; },
277+ stemWord: function(w){ return w; }
278+ };
279+ };
275280 }
276281 if (typeof ChineseStemmer === 'undefined') {
277282 window.ChineseStemmer = window.Stemmer;
You can’t perform that action at this time.
0 commit comments