I have this same need, my lib annotates Ruby files (https://atom.io/packages/seeing-is-believing), and it would be nice for it to work on a codeblock inside of Markdown. However, there does not appear to be a way to select the Ruby code from the codeblock.
Example, consider this markdown:
This is markdown
'this is Ruby'
a = 1 # <-- place the cursor here
a + a
And this is markdown again
Then I want to get the text from
'this is Ruby' through
a + a. I also looked at the Markdown source code and found a few useful things, but the OP already pointed them out, and I had the same issue (that the selector only selects the line, not the block).
I’m sure there’s a way to do this, but I looked around for a while and don’t see it, but how do I select the text that matches a scope? eg given that
".source.gfm .markup.code.ruby.gfm .source.embedded.ruby .constant.numeric.ruby", how do I select all the text under
.source.gfm, which I’d expect to be the entire file, or under
.markup.code.ruby which might be the text I’m interested in.