Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Allow you to inject your own parser.
Why bother just letting you do markdown? And why tie you to RedCarpet?
- Loading branch information
1 parent
56aa762
commit 84f4bb751cf7fd3284d1e0eeb8871da4fda53fe7
Showing
5 changed files
with
60 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| module Metadown | ||
| class MetadataParser | ||
| def initialize(text) | ||
| @text = text | ||
| @metadata = {} | ||
| end | ||
|
|
||
| def parse | ||
| @text =~ /^(---\s*\n.*?\n?)^(---\s*$\n?)/m | ||
| @mtext = YAML.load($1) if $1 | ||
| end | ||
| end | ||
| end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| module Metadown | ||
| # The current released version of Metadown | ||
| VERSION = "1.0.1" | ||
| VERSION = "1.1.0.beta" | ||
| end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters