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 getSourceLines and getSource to Block API #402

Merged
merged 1 commit into from
Dec 26, 2017

Conversation

mojavelinux
Copy link
Member

No description provided.

@mojavelinux
Copy link
Member Author

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.

@mojavelinux
Copy link
Member Author

It's also consistent with the method name on Document.

@ggrossetie ggrossetie self-requested a review December 25, 2017 20:56
@@ -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.'])
Copy link
Member

@ggrossetie ggrossetie Dec 25, 2017

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... 😉

@@ -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.')
Copy link
Member

Choose a reason for hiding this comment

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

Missing semicolon

@@ -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.'])
Copy link
Member

Choose a reason for hiding this comment

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

Missing semicolon

@mojavelinux
Copy link
Member Author

Perhaps you could add the linter as part of the test task. I always forgot to run it because it's not linked.

@ggrossetie
Copy link
Member

Perhaps you could add the linter as part of the test task. I always forgot to run it because it's not linked.

Yes that's an excellent idea. It happened to me too!

@ggrossetie ggrossetie merged commit 8e02554 into asciidoctor:master Dec 26, 2017
@mojavelinux
Copy link
Member Author

👍

@mojavelinux mojavelinux deleted the block-source-api branch December 26, 2017 23:01
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.

2 participants