Skip to content

Conversation

@StephanMeijer
Copy link

@StephanMeijer StephanMeijer commented Nov 28, 2025

Summary

  • Move Inter font settings into Normal style and normalize rFonts (ascii/cs/eastAsia/hAnsi)
  • Use ECMA-376 shading semantics (w:val="clear" + w:fill) instead of w:color + "solid"
  • Emit table cell widths as numeric dxa values (twips) instead of "pt" strings
  • Introduce SourceCode, VerbatimChar, and BlockQuote styles and map code/quotes to them

Rationale

This makes the generated DOCX closer to Word’s own output and improves behavior in Word, LibreOffice, and converters like Pandoc and DocSpec.

Diff of output (DOCX)

after.docx
before.docx

Proving interopability: HTML

Using pandoc for converting to HTML:

$ pandoc before.docx -o before.html --standalone --embed-resources
$ pandoc after.docx  -o after.html  --standalone --embed-resources

before.html
after.html

Click here to see diff.
7c7
<   <title>before</title>
---
>   <title>after</title>
280,282c280,283
< <p>const helloWorld = (message) =&gt; {<br />
< console.log(&quot;Hello World&quot;, message);<br />
< };</p>
---
> <pre><code>const helloWorld = (message) =&gt; {
>   console.log(&quot;Hello World&quot;, message);
> };</code></pre>
> <blockquote>
284c285,286
< <p>Some inline code: var x = 123;</p>
---
> </blockquote>
> <p>Some inline code: <code>var x = 123;</code></p>

Proving interopability: Markdown

Using pandoc for converting to Markdown:

$ pandoc before.docx -o before.md
$ pandoc after.docx -o after.md

before.md
after.md

Click here to see diff.
97,99c97,99
< const helloWorld = (message) =\> {\
< console.log(\"Hello World\", message);\
< };
---
>     const helloWorld = (message) => {
>       console.log("Hello World", message);
>     };
101c101
< Lorem Ipsum Dolor Sit Amet I am a BlockQuote.
---
> > Lorem Ipsum Dolor Sit Amet I am a BlockQuote.
103c103
< Some inline code: var x = 123;
---
> Some inline code: `var x = 123;`

Changes

See above.

Impact

Theoretical possibility to potentially break things.

Testing

Automated tests.

Checklist

  • Code follows the project's coding standards.
  • Unit tests covering the new feature have been added.
  • All existing tests pass.

* Move Inter font settings into Normal style and normalize rFonts (ascii/cs/eastAsia/hAnsi)
* Use ECMA-376 shading semantics (w:val="clear" + w:fill) instead of w:color + "solid"
* Emit table cell widths as numeric dxa values (twips) instead of "pt" strings
* Introduce SourceCode, VerbatimChar, and BlockQuote styles and map code/quotes to them

This makes the generated DOCX closer to Word’s own output and improves behavior
in Word, LibreOffice, and converters like Pandoc and DocSpec.
@vercel
Copy link

vercel bot commented Nov 28, 2025

@StephanMeijer is attempting to deploy a commit to the TypeCell Team on Vercel.

A member of the Team first needs to authorize it.

Comment on lines -146 to -148
shading: {
color: "#7D797A",
},
Copy link
Author

Choose a reason for hiding this comment

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

The shading was never rendered out. In case we do want this shading to be rendered out, let me know so I can add it to the BlockQuote style.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant