Output HTML through the Markdown parser and search for DOM elements using Nokogiri.If Markdown and/or search criteria are complicated, this is the surest thing.
An advanced Markdown parser such as Redcarpet may have a way to customize the behavior, so you can use it to hook the rendering of the list element and output the data somewhere.
If it's a simple way, you might want to search for the Markdown source by regular expression.
source.scan(/^\s*-\s*\[(.*)\]\s*(.*)$/){|s|...}
US>%s is passed in an array of characters and subsequent strings.There are difficulties such as being indistinguishable from inside and outside the code block or being difficult to handle nested lists, but this is sufficient if you are certain that the source format will be limited.
How about regular expressions (Ruby can only be used in standard libraries)
Sample
http://rubular.com/r/nkgIQByUuS
Easy-to-understand regular expression commentary
http://qiita.com/jnchito/items/893c887fbf19e17d3ff9
Function to search for regular expressions in Ruby
http://ref.xaio.jp/ruby/classes/string/scan
If you make good use of groups, you can get only the checked strings.
Try it.
617 Uncaught (inpromise) Error on Electron: An object could not be cloned
572 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
610 GDB gets version error when attempting to debug with the Presense SDK (IDE)
578 Understanding How to Configure Google API Key
912 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
© 2024 OneMinuteCode. All rights reserved.