Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

svelte-render-md

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

svelte-render-md - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

0

index.d.ts
import RenderHTML from "./RenderHTML.svelte";
import { parseContent } from "./md_to_html";
export { RenderHTML, parseContent };

@@ -0,0 +0,0 @@ export function mdToHTML(mdStr: any): any;

10

md_to_html.js

@@ -5,3 +5,5 @@ import * as yaml from 'js-yaml'

function mdToHTML(mdStr) {
let converter = new showdown.Converter();
let converter = new showdown.Converter({
tables: true
});
return converter.makeHtml(mdStr);;

@@ -21,6 +23,6 @@ }

}
return {
frontmatter: yaml.load(yamlStr),
content: mdStr
frontmatter: yaml.load(yamlStr),
content: mdStr
}

@@ -27,0 +29,0 @@ }

{
"name": "svelte-render-md",
"version": "0.0.4",
"version": "0.0.5",
"exports": {
"./package.json": "./package.json",
".": "./index.js",
"./md_to_html": "./md_to_html.js",
"./RenderHTML.svelte": "./RenderHTML.svelte"
"./RenderHTML.svelte": "./RenderHTML.svelte",
"./md_to_html": "./md_to_html.js"
},

@@ -10,0 +10,0 @@ "module": "index.js",

@@ -8,5 +8,11 @@ # svelte-render-md

```
import { readMDFile } from "svelte-render-md";
let mdFile = readMDFile("myFile.md");
let frontmatter = mdFile.frontmatter;
import { parseContent } from "svelte-render-md";
let mdContent = "---\n
name: 'test'\n
description: 'This is a test'\n
---\n
# Test\n
This is to test the content parser\n";
let content = parseContent(mdContent);
let frontmatter = content.frontmatter;
```

@@ -22,8 +28,15 @@ ### Render md as HTML

```
You can also render an md file as html:
Combine the two to render file content as html and retrieve frontmatter:
```
<script>
import { RenderHTML, readMDFile } from "svelte-render-md";
let mdFile = readMDFile("myFile.md");
let mdStr = mdFile.content;
import { RenderHTML, parseContent } from "svelte-render-md";
let mdContent = "---\n
name: 'test'\n
description: 'This is a test'\n
---\n
# Test\n
This is to test the content parser\n";
let content = parseContent(mdContent);
let frontmatter = content.frontmatter;
let mdStr = content.content;
</script>

@@ -30,0 +43,0 @@

@@ -0,0 +0,0 @@ /** @typedef {typeof __propDef.props} RenderHtmlProps */

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc