-
-
Notifications
You must be signed in to change notification settings - Fork 0
[#132] Add Highlight.js syntax highlighter module. #138
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -47,6 +47,7 @@ module: | |
| gin_toolbar: 0 | ||
| google_tag: 0 | ||
| help: 0 | ||
| highlight_js: 0 | ||
| history: 0 | ||
| image: 0 | ||
| image_captcha: 0 | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,12 @@ | ||||||||||
| copy_enable: true | ||||||||||
| copy_bg_transparent: false | ||||||||||
| copy_bg_color: '#4243b1' | ||||||||||
| copy_txt_color: '#ffffff' | ||||||||||
| copy_btn_text: '' | ||||||||||
| copy_success_text: '' | ||||||||||
| success_txt_color: '#ffffff' | ||||||||||
| role_copy_access: { } | ||||||||||
| languages: { } | ||||||||||
|
Comment on lines
+8
to
+9
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix YAML lint: too many spaces inside empty braces on both lines. YAMLlint flags both 🔧 Proposed fix-role_copy_access: { }
-languages: { }
+role_copy_access: {}
+languages: {}📝 Committable suggestion
Suggested change
🧰 Tools🪛 YAMLlint (1.38.0)[error] 8-8: too many spaces inside empty braces (braces) [error] 9-9: too many spaces inside empty braces (braces) 🤖 Prompt for AI Agents |
||||||||||
| theme: github | ||||||||||
| success_bg_transparent: false | ||||||||||
| success_bg_color: '#4243b1' | ||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,7 +17,7 @@ Feature: Seckit | |
| And the response header "Content-Security-Policy" should contain the value "media-src 'self'" | ||
| And the response header "Content-Security-Policy" should contain the value "report-uri /report-csp-violation" | ||
| And the response header "Content-Security-Policy" should contain the value "script-src 'self' https://www.googletagmanager.com https://www.gstatic.com https://www.recaptcha.net https://www.google.com https://cdnjs.cloudflare.com https://cdn.jsdelivr.net/gh/cferdinandi/tabby@12.0.3/dist/js/tabby.min.js https://unpkg.com/@popperjs/core@2.11.6/dist/umd/popper.js https://unpkg.com/tippy.js@6.3.7/dist/tippy.umd.js;" | ||
| And the response header "Content-Security-Policy" should contain the value "style-src 'self' 'unsafe-inline' https://fonts.googleapis.com/ https://cdn.jsdelivr.net/gh/cferdinandi/tabby@12.0.3/dist/css/tabby-ui.min.css https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.12/codemirror.css https://unpkg.com/tippy.js@6.3.7/dist/tippy.css https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.13/css/select2.min.css;" | ||
| And the response header "Content-Security-Policy" should contain the value "style-src 'self' https://cdnjs.cloudflare.com/ajax/libs/highlight.js/ 'unsafe-inline' https://fonts.googleapis.com/ https://cdn.jsdelivr.net/gh/cferdinandi/tabby@12.0.3/dist/css/tabby-ui.min.css https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.12/codemirror.css https://unpkg.com/tippy.js@6.3.7/dist/tippy.css https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.13/css/select2.min.css;" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Order-sensitive substring match may produce false failures on CSP source reordering. The Behat step Consider verifying that seckit's source ordering is stable across upgrades, or note this as a known maintenance point whenever 🤖 Prompt for AI Agents |
||
| And the response header "Strict-Transport-Security" should contain the value "max-age=31536000" | ||
| And the response header "Strict-Transport-Security" should contain the value "includeSubDomains" | ||
| And the response header "Strict-Transport-Security" should contain the value "preload" | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,5 @@ | ||||||
| highlight_js.gherkin: | ||||||
| js: | ||||||
| https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/gherkin.min.js: { type: external, minified: true } | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix YAML lint: remove extra spaces inside braces. YAMLlint reports 🔧 Proposed fix- https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/gherkin.min.js: { type: external, minified: true }
+ https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/gherkin.min.js: {type: external, minified: true}📝 Committable suggestion
Suggested change
🧰 Tools🪛 YAMLlint (1.38.0)[error] 3-3: too many spaces inside braces (braces) [error] 3-3: too many spaces inside braces (braces) 🤖 Prompt for AI Agents |
||||||
| dependencies: | ||||||
| - highlight_js/highlight_js.js | ||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| namespace Drupal\do_base\Hook; | ||
|
|
||
| use Drupal\Core\Hook\Attribute\Hook; | ||
|
|
||
| /** | ||
| * Library info alter hooks for do_base module. | ||
| */ | ||
| final class LibraryInfoAlterHook { | ||
|
|
||
| /** | ||
| * Implements hook_library_info_alter(). | ||
| * | ||
| * Attaches Gherkin language support whenever Highlight.js is loaded. | ||
| * The CDN common bundle does not include Gherkin, so we load it separately. | ||
| */ | ||
| #[Hook('library_info_alter')] | ||
| public function alter(array &$libraries, string $extension): void { | ||
| if ($extension === 'highlight_js' && isset($libraries['highlight_js.custom'])) { | ||
| $libraries['highlight_js.custom']['dependencies'][] = 'do_base/highlight_js.gherkin'; | ||
| } | ||
| } | ||
|
|
||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
composer.lockmust be committed alongside this change.The PR description acknowledges this is deferred, but shipping without an updated
composer.lockmeans the resolved transitive dependency tree is undefined for all environments. CI may resolve a different constraint than intended, and reproducible builds are broken until the lock file is committed.🤖 Prompt for AI Agents