Socket
Socket
Sign inDemoInstall

@tiptap/extension-bold

Package Overview
Dependencies
Maintainers
4
Versions
162
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tiptap/extension-bold - npm Package Compare versions

Comparing version 2.3.2 to 2.4.0

16

dist/index.js
import { Mark, mergeAttributes, markInputRule, markPasteRule } from '@tiptap/core';
/**
* Matches bold text via `**` as input.
*/
const starInputRegex = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/;
/**
* Matches bold text via `**` while pasting.
*/
const starPasteRegex = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g;
/**
* Matches bold text via `__` as input.
*/
const underscoreInputRegex = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/;
/**
* Matches bold text via `__` while pasting.
*/
const underscorePasteRegex = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g;
/**
* This extension allows you to mark text as bold.
* @see https://tiptap.dev/api/marks/bold
*/
const Bold = Mark.create({

@@ -8,0 +24,0 @@ name: 'bold',

@@ -7,6 +7,22 @@ (function (global, factory) {

/**
* Matches bold text via `**` as input.
*/
const starInputRegex = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/;
/**
* Matches bold text via `**` while pasting.
*/
const starPasteRegex = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g;
/**
* Matches bold text via `__` as input.
*/
const underscoreInputRegex = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/;
/**
* Matches bold text via `__` while pasting.
*/
const underscorePasteRegex = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g;
/**
* This extension allows you to mark text as bold.
* @see https://tiptap.dev/api/marks/bold
*/
const Bold = core.Mark.create({

@@ -13,0 +29,0 @@ name: 'bold',

import { Mark } from '@tiptap/core';
export interface BoldOptions {
/**
* HTML attributes to add to the bold element.
* @default {}
* @example { class: 'foo' }
*/
HTMLAttributes: Record<string, any>;

@@ -23,6 +28,22 @@ }

}
/**
* Matches bold text via `**` as input.
*/
export declare const starInputRegex: RegExp;
/**
* Matches bold text via `**` while pasting.
*/
export declare const starPasteRegex: RegExp;
/**
* Matches bold text via `__` as input.
*/
export declare const underscoreInputRegex: RegExp;
/**
* Matches bold text via `__` while pasting.
*/
export declare const underscorePasteRegex: RegExp;
/**
* This extension allows you to mark text as bold.
* @see https://tiptap.dev/api/marks/bold
*/
export declare const Bold: Mark<BoldOptions, any>;

4

package.json
{
"name": "@tiptap/extension-bold",
"description": "bold extension for tiptap",
"version": "2.3.2",
"version": "2.4.0",
"homepage": "https://tiptap.dev",

@@ -32,3 +32,3 @@ "keywords": [

"devDependencies": {
"@tiptap/core": "^2.3.2"
"@tiptap/core": "^2.4.0"
},

@@ -35,0 +35,0 @@ "peerDependencies": {

@@ -9,2 +9,7 @@ import {

export interface BoldOptions {
/**
* HTML attributes to add to the bold element.
* @default {}
* @example { class: 'foo' }
*/
HTMLAttributes: Record<string, any>,

@@ -32,7 +37,26 @@ }

/**
* Matches bold text via `**` as input.
*/
export const starInputRegex = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/
/**
* Matches bold text via `**` while pasting.
*/
export const starPasteRegex = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g
/**
* Matches bold text via `__` as input.
*/
export const underscoreInputRegex = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/
/**
* Matches bold text via `__` while pasting.
*/
export const underscorePasteRegex = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g
/**
* This extension allows you to mark text as bold.
* @see https://tiptap.dev/api/marks/bold
*/
export const Bold = Mark.create<BoldOptions>({

@@ -39,0 +63,0 @@ name: 'bold',

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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