๐ค Simple markup
Biblo addon for parsing simple markup.
Bold textโ
"Lorem **bold** ipsum"
โก๏ธ Lorem bold ipsum
Italic textโ
"Lorem _italic_ ipsum"
โก๏ธ Lorem italic ipsum
Strike through textโ
"Lorem ~~strike through~~ ipsum"
โก๏ธ Lorem strike through ipsum
Installationโ
- ๐ฆ npm
- ๐งถ Yarn
npm install --save @biblo/addon-simple-markup
yarn add @biblo/addon-simple-markup
Initializationโ
Import the addon and add it to BibloProvider
:
import React from "react";
import {
bibloImporter,
BibloProvider,
} from "@biblo/react-native";
// Import the addon
import BibloAddonSimpleMarkup from "@biblo/addon-simple-markup";
const components = bibloImporter(
require.context("/", true, /\.biblo\.[tj]sx?$/),
);
export default function App() {
return (
<BibloProvider
// Apply the addon
addons={[BibloAddonSimpleMarkup]}
components={components}
>
...
</BibloProvider>
);
}
Optionsโ
The default markup is set with
**
for bold_
for italic~~
forstrike through
This can be changed by passing an object to BibloAddonSimpleMarkup
:
<BibloProvider
addons={[
BibloAddonSimpleMarkup({
bold: "*",
italic: "__",
strikeThrough: "--",
}),
]}
components={components}
>
...
</BibloProvider>