Browse Source

doc: add metadata code example

Christian Genco 7 years ago
parent
commit
0c6ce94673
1 changed files with 6 additions and 0 deletions
  1. 6 0
      README.md

+ 6 - 0
README.md

@@ -367,6 +367,12 @@ var defaultOptions = showdown.getDefaultOptions();
 
  * **metadata**: (boolean) [default false] Enable support for document metadata (defined at the top of the document
    between `«««` and `»»»` or between `---` and `---`).  (since v.1.8.5)
+   
+   ```js
+   var conv = new showdown.Converter({metadata: true});
+   var html = conv.makeHtml(someMd);
+   var metadata = conv.getMetadata(); // returns an object with the document metadata
+   ```
 
  * **splitAdjacentBlockquotes**: (boolean) [default false] Split adjacent blockquote blocks.(since v.1.8.6)