New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

solid-highlight

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

solid-highlight

Solid component for syntax highlighting, based on react-highlight and highlightjs' vue plugin

Source
npmnpm
Version
0.1.18
Version published
Weekly downloads
2K
-29.96%
Maintainers
1
Weekly downloads
 
Created
Source

solid-highlight

solid-highlight

size size npm pnpm

solid-highlight

Documentation

Installation

npm i solid-highlight
# or
yarn add solid-highlight
# or
pnpm add solid-highlight

Usage

Importing component

import Highlight from "solid-highlight";

Adding styles

Choose the theme for syntax highlighting and add corresponding styles of highlight.js, either as a stylesheet or by importing in your index.tsx file

  <link rel="stylesheet" href="/path/to/styles/theme-name.css">
import "highlight.js/styles/stackoverflow-light.css";

The styles will most likely be in node_modules/highlight.js/styles folder.

Properties

PropertyTypeDefaultDescription
classstringCustom css classes to be included
languagestring (optional)''Language of code to be highlighted (will be detected automatically by default)
autoDetectboolean (optional)trueWhether to automatically detect the language of code to be highlighted
ignoreIllegalsboolean (optional)trueWhether to ignore illegal characters in the code to be highlighted

Syntax highlighting of code snippet

Code snippet that requires syntax highlighting should be passed as children to Highlight component in string format.

<Highlight autoDetect={true}> {"function foo() { return 'bar' }"} </Highlight>
<Highlight autoDetect={false} language={"js"}>
  {"function foo() { return 'bar' }"}
</Highlight>

Keywords

solidjs component

FAQs

Package last updated on 25 Jan 2024

Did you know?

Socket

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.

Install

Related posts