@fonnpo/mdc
v0.23.2
Published
Nuxt MDC module
Downloads
320
Readme
This primarily addresses the issue where excessive content in the code field during a highlight GET request causes a 431 error.
const long = (code || '').split('\n').length > 260
const result = await $fetch<HighlightResult | undefined>('/api/_mdc/highlight', {
method: long ? 'POST' : 'GET',
[long ? 'body' : 'params']: {
code,
lang,
theme: JSON.stringify(theme),
options: JSON.stringify(options),
},
})const { code, lang, theme: themeString, options: optionsStr } = event.method === 'POST' ? await readBody(event) : getQuery(event)