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

Add data-line attrs support for heading and paragraph #156

Closed
wants to merge 1 commit into from

Conversation

sofiushko
Copy link
Contributor

No description provided.

@yc-ui-bot
Copy link
Contributor

Preview is ready.

@d3m1d0v d3m1d0v changed the title Add data-line atts support for heading and paragraph Add data-line attrs support for heading and paragraph Nov 16, 2023

return [
'p',
lineNumber === undefined ? {} : {headingLineNumberAttr: lineNumber},
Copy link
Member

Choose a reason for hiding this comment

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

{default: null}

so maybe check should be lineNumber === null ?

{headingLineNumberAttr: lineNumber}

square brackets is missed: {[headingLineNumberAttr]: lineNumber}

@@ -8,6 +8,8 @@ export enum BaseNode {
Paragraph = 'paragraph',
}

const headingLineNumberAttr = 'data-line';
Copy link
Member

Choose a reason for hiding this comment

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

headingLineNumberAttr

it's paragraph's attribute name)


return [
'h' + node.attrs[headingLevelAttr],
lineNumber === undefined ? {} : {headingLineNumberAttr: lineNumber},
Copy link
Member

Choose a reason for hiding this comment

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

same

@sofiushko sofiushko closed this Nov 16, 2023
@sofiushko
Copy link
Contributor Author

#158

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.

3 participants