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

Too many parentheses seem to result in incorrect styles #4179

Open
wfh010624 opened this issue Dec 2, 2024 · 2 comments
Open

Too many parentheses seem to result in incorrect styles #4179

wfh010624 opened this issue Dec 2, 2024 · 2 comments
Labels
bug help welcome Could use help from community parser

Comments

@wfh010624
Copy link

Describe the issue/behavior that seems buggy

The following code should display correctly, but when I limit the length of a VARCHAR, the style becomes incorrect
Sample Code or Instructions to Reproduce

<template>
    <highlightjs language="sql" :code="testSql" />
    <highlightjs language="sql" :code="testSql2" />
</template>
<script setup name="bizSimple">
	const testSql = 'CREATE TABLE ads_jyzs_stm_sale_store_cd(\n' +
		'    id VARCHAR,\n' +
		'    datedday DATE,\n' +
		'    org_gid INT4,\n' +
		'    store_gid INT4,\n' +
		'    store_code VARCHAR,\n' +
		'    store_name VARCHAR,\n' +
		'    salamt DECIMAL(24,4),\n' +
		'    pct DECIMAL(24,4),\n' +
		'    salqty DECIMAL(24,4),\n' +
		'    bckqty DECIMAL(24,4),\n' +
		'    tar_salamt DECIMAL(24,4),\n' +
		'    cv INT4,\n' +
		'    mb_cv INT4,\n' +
		'    mb_sv INT4,\n' +
		'    shelfsale_skucnt INT8,\n' +
		'    PRIMARY KEY (id)\n' +
		')'
	const testSql2 = 'CREATE TABLE ads_jyzs_stm_sale_store_cd(\n' +
		'    id VARCHAR,\n' +
		'    datedday DATE,\n' +
		'    org_gid INT4,\n' +
		'    store_gid INT4,\n' +
		'    store_code VARCHAR(32),\n' +
		'    store_name VARCHAR,\n' +
		'    salamt DECIMAL(24,4),\n' +
		'    pct DECIMAL(24,4),\n' +
		'    salqty DECIMAL(24,4),\n' +
		'    bckqty DECIMAL(24,4),\n' +
		'    tar_salamt DECIMAL(24,4),\n' +
		'    cv INT4,\n' +
		'    mb_cv INT4,\n' +
		'    mb_sv INT4,\n' +
		'    shelfsale_skucnt INT8,\n' +
		'    PRIMARY KEY (id)\n' +
		')'
</script>

Expected behavior

the same style before and after the change
Additional context

image

@wfh010624 wfh010624 added bug help welcome Could use help from community parser labels Dec 2, 2024
@wfh010624
Copy link
Author

wfh010624 commented Dec 2, 2024

Additional:
"highlight.js": "^11.10.0",
"vue": "3.2.44",
main.js:

import hljs from "highlight.js/lib/core";
import hljsVuePlugin from "@highlightjs/vue-plugin";
import sql from "highlight.js/lib/languages/sql";

hljs.registerLanguage("sql", sql);
const app = createApp(App)
app.use(hljsVuePlugin)

app.mount('#app')

@joshgoebel
Copy link
Member

Can you confirm this behavior using the demo? I think the vue plugin may be broken here. This does not look like sql to me in your second example - so no wonder nothing is highlighted correctly.

https://highlightjs.org/demo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug help welcome Could use help from community parser
Projects
None yet
Development

No branches or pull requests

2 participants