
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@nulib/use-markdown
Advanced tools
React hook for handling of Markdown in web applications with support for [GitHub flavored markdown](https://github.github.com/gfm/) content.
React hook for handling of Markdown in web applications with support for GitHub flavored markdown content.
Install the hook using your dependency manager.
npm i @nulib/use-markdown
Import the hook into your React application.
import React from "react";
import useMarkdown from "@nulib/use-markdown";
const MyComponent = () => {
const markdown = "# Heading 1";
// returns both raw html and a jsx component with innerHtml content
const { html, jsx } = useMarkdown(markdown);
return <div>{jsx}</div>;
};
export default MyComponent;
Alternatively, you can do something with the html
string directly.
const { html } = useMarkdown(markdown);
// Do something with the html string
const newHtml = html + "<p>foo</p>";
return <div dangerouslySetInnerHTML={{ __html: newHtml }} />;
Run in development environment.
npm i
npm run dev
A browser session will begin:
VITE v5.2.8 ready in 84 ms
➜ Local: http://localhost:5173/
➜ Network: use --host to expose
➜ press h + enter to show help
FAQs
React hook for handling of Markdown in web applications with support for [GitHub flavored markdown](https://github.github.com/gfm/) content.
We found that @nulib/use-markdown demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.