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

feat(markdoc): Support markdown-it's typographer option #11450

Merged
merged 6 commits into from
Jul 17, 2024

Conversation

schpet
Copy link
Contributor

@schpet schpet commented Jul 10, 2024

Changes

this allows people to use markdown-it's typographer option:

// https://astro.build/config
export default defineConfig({
  integrations: [markdoc({ typographer: true })],
});

the typographer option converts regular quotes to curly quotes. it's mentioned in the markdown-it readme.

Testing

a test was added to packages/integrations/markdoc/test/render.test.js confirming that regular quotes were replaced with the fancy variety.

Docs

it could use an additional section in the markdoc docs:
https://docs.astro.build/en/guides/integrations-guide/markdoc/#integration-config-options

/cc @withastro/maintainers-docs let me know if i should make a PR to add docs for this option to https://github.com/withastro/docs

Try it out

it took me a minute to figure out how to run my fork, but with these changes to the package.json i was able to run and deploy it:

{
  "dependencies": {
    "@astrojs/markdoc": "https://github.com/schpet/astro/releases/download/markdoc-typographer%400.1/astrojs-markdoc-0.11.1.tgz",
  },
  "pnpm": {
    "overrides": {
      "@astrojs/internal-helpers": "npm:@astrojs/internal-helpers",
      "@astrojs/markdown-remark": "npm:@astrojs/markdown-remark",
      "@astrojs/prism": "npm:@astrojs/prism"
    }
  }
}

Copy link

changeset-bot bot commented Jul 10, 2024

🦋 Changeset detected

Latest commit: b5b5034

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added the pkg: integration Related to any renderer integration (scope) label Jul 10, 2024
@schpet schpet force-pushed the markdoc-typographer branch from 0f0c013 to 38881ec Compare July 10, 2024 15:31
@schpet schpet changed the title Support markdoc-it's typographer option in markdoc feat(markdoc): Support markdoc-it's typographer option Jul 10, 2024
@schpet schpet changed the title feat(markdoc): Support markdoc-it's typographer option feat(markdoc): Support markdown-it's typographer option Jul 10, 2024
@schpet schpet force-pushed the markdoc-typographer branch from 38881ec to d625c17 Compare July 10, 2024 16:51
@bluwy bluwy requested a review from bholmesdev July 17, 2024 07:35
Copy link
Contributor

@bholmesdev bholmesdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

“good job”

@Princesseuh Princesseuh merged commit eb303e1 into withastro:main Jul 17, 2024
5 checks passed
@astrobot-houston astrobot-houston mentioned this pull request Jul 17, 2024
ematipico pushed a commit that referenced this pull request Jul 18, 2024
* Support markdoc-it's typographer option in markdoc

* Update .changeset/forty-scissors-jog.md [skip ci]

* Update .changeset/forty-scissors-jog.md [skip ci]

* Fix typo in changeset

---------

Co-authored-by: Bjorn Lu <[email protected]>
Co-authored-by: Erika <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: integration Related to any renderer integration (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants