`tabWidth` ignored on imported code
I'm working with the Starlight Basics template and it seems the tabWidth setting is working correctly with inline code blocks but being ignored for imported files in the <Code> component. Is there a setting i've missed?
Hello! Thank you for reporting this! I just had a look at the code and you're right, the tabWidth setting is only used by the rehype plugin to convert tabs in Markdown/MDX source code to spaces. The Code component uses another code path which doesn't get processed by this setting at all.
I think I can fix this by not replacing the tabs with spaces at all, but using CSS instead to apply the desired tab width to the rendered code blocks. Is my assumption correct that you primarily care about the displayed width of the leading indentation and don't mind whether the HTML output contains spaces or actual tabs?
Yes thats right, any way of being able to adjust the displayed width would be awesome.
I made the replacement of tabs with spaces consistent between fenced code blocks and the <Code> component in version 0.38.2, published to NPM today.
Thanks again for reporting this and sorry it took so long!