Refactor HTML to remove type attribute from style tags#1294
Open
pardeyke wants to merge 1 commit intobasecamp:mainfrom
Open
Refactor HTML to remove type attribute from style tags#1294pardeyke wants to merge 1 commit intobasecamp:mainfrom
pardeyke wants to merge 1 commit intobasecamp:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR aligns the project’s HTML/CSS inclusion patterns with modern HTML standards by removing the redundant type="text/css" attribute from <style> and stylesheet <link> tags across source, docs, test fixtures, and the Action Text bundled build.
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
Changes:
- Removed
type="text/css"from dynamically created<style>elements used for per-custom-element default CSS. - Updated test fixtures and test helper HTML-injection to use bare
<style>tags. - Updated documentation and static HTML assets to omit
type="text/css"on stylesheet links and style blocks.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/trix/core/helpers/custom_elements.js | Stops setting type="text/css" on injected <style> elements (keeps nonce + data attributes intact). |
| action_text-trix/app/assets/javascripts/trix.js | Mirrors the same removal in the bundled Action Text JS artifact. |
| src/test/test_helper.js | Updates global test <style> injection to omit the type attribute. |
| src/test/test_helpers/fixtures/editor_with_styled_content.js | Updates fixture <style> tag to omit the type attribute. |
| src/test/test_helpers/fixtures/editor_with_bold_styles.js | Updates fixture <style> tag to omit the type attribute. |
| src/test/test_helpers/fixtures/editor_with_block_styles.js | Updates fixture <style> tag to omit the type attribute. |
| README.md | Updates CDN usage example to omit type="text/css" on the stylesheet link. |
| assets/test.html | Updates stylesheet link to omit type="text/css". |
| assets/index.html | Updates stylesheet link and inline <style> to omit type="text/css". |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request standardizes the way CSS stylesheets and style elements are included throughout the project by removing the unnecessary
type="text/css"attribute from<link>and<style>tags. This change simplifies the code and aligns with current HTML standards, as specifying the type is no longer required.