-
-
Notifications
You must be signed in to change notification settings - Fork 135
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 getSourceLines and getSource to Block API #402
Conversation
I decided to use the API getSourceLines() instead of getLines() since it's a more accurate name. I may add that alias to core as well. |
It's also consistent with the method name on Document. |
spec/node/asciidoctor.spec.js
Outdated
@@ -141,6 +141,8 @@ describe('Node.js', function () { | |||
expect(blocks[1].getBlocks()[1].getId()).toBe('blockid'); | |||
expect(blocks[1].getBlocks()[1].getStyle()).toBe('quote'); | |||
expect(blocks[1].getBlocks()[1].getAttribute('attribution')).toBe('Abraham Lincoln'); | |||
expect(blocks[1].getBlocks()[1].getSourceLines()).toEqual(['This is a quote.', 'It has a title, id, and attribution.']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At some point we may switch to https://standardjs.com/ and remove semicolons but in the meantime... 😉
spec/node/asciidoctor.spec.js
Outdated
@@ -141,6 +141,8 @@ describe('Node.js', function () { | |||
expect(blocks[1].getBlocks()[1].getId()).toBe('blockid'); | |||
expect(blocks[1].getBlocks()[1].getStyle()).toBe('quote'); | |||
expect(blocks[1].getBlocks()[1].getAttribute('attribution')).toBe('Abraham Lincoln'); | |||
expect(blocks[1].getBlocks()[1].getSourceLines()).toEqual(['This is a quote.', 'It has a title, id, and attribution.']) | |||
expect(blocks[1].getBlocks()[1].getSource()).toBe('This is a quote.\nIt has a title, id, and attribution.') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon
spec/node/asciidoctor.spec.js
Outdated
@@ -141,6 +141,8 @@ describe('Node.js', function () { | |||
expect(blocks[1].getBlocks()[1].getId()).toBe('blockid'); | |||
expect(blocks[1].getBlocks()[1].getStyle()).toBe('quote'); | |||
expect(blocks[1].getBlocks()[1].getAttribute('attribution')).toBe('Abraham Lincoln'); | |||
expect(blocks[1].getBlocks()[1].getSourceLines()).toEqual(['This is a quote.', 'It has a title, id, and attribution.']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon
Perhaps you could add the linter as part of the test task. I always forgot to run it because it's not linked. |
e9373e2
to
97fa98a
Compare
Yes that's an excellent idea. It happened to me too! |
👍 |
No description provided.