Skip to content

Content Insertion into <head> does not respect file types #993

Description

@alyip98

Tell us about your environment

  • MarkBind Version: 2.9.0

What did you do? Please include the actual source code causing the issue.
According to the UG, adding raw JS and CSS files to the <head> is supported.

I attempted to insert a custom CSS file into the head of a page.

index.md

<frontmatter>
  header: header.md
  pageNav: 2
  pageNavTitle: "Chapters of This Page"
  siteNav: site-nav.md
  head: customStyles.css
</frontmatter>

customStyles.css

.test {
	color: red;
}

What did you expect to happen?
I expected the contents of customStyles.css to be wrapped in a <style> tag and inserted.

What actually happened? Please include the actual, raw output.
The contents of customStyles.css is inserted raw, i.e. without being wrapped in a <style> tag.

This issue also affects JS files inserted this way.

Proposed solution:
Edit Page.js to wrap contents in <style> and <script> tags for CSS and JS files respectively.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions