Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: Updated docs generator code to use changed API of cheerio library #1007

Merged
merged 1 commit into from
Jul 29, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions docs/tasks/processor.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ function highlite($) {
type = script.attr('type') || 'text/plain';
lang = klass.split('-')[1];
gram = prism.languages[lang];
code = unindent(script.text()).replace(/scrxpt/g, 'script');
code = unindent(script.html()).replace(/scrxpt/g, 'script');
setup($, figure, script, klass, type, lang, gram, code);
code = klass === 'language-javascript' ? compile(code).code : code;
figure.attr('data-ts.code', encodeURIComponent(code));
Expand All @@ -176,7 +176,7 @@ function highlite($) {
$('[data-ts=DoxApi]').each(function(i, table) {
script = $(table).find('script');
if (script) {
code = unindent(script.text());
code = unindent(script.html());
$(table).attr('data-ts.code', encodeURIComponent(code));
script.remove();
}
Expand Down Expand Up @@ -341,6 +341,11 @@ function includetags($, source) {
var pre = preparsers(include, $);
var post = postparsers(include, $);
html = fetchinclude(file, hash, pre, post);
if (href === 'tabs.xhtml') {
// if it is a "tabs.xhtml" we need to append it to <head>
// because it contains a list of "<link prefetch>"
include.appendTo('head');
}
} else {
console.log('Human error: "' + file + '" not found!!!');
console.log(badinclude(file));
Expand Down