![Maven Central Adds Sigstore Signature Validation](https://cdn.sanity.io/images/cgdhsj6q/production/7da3bc8a946cfb5df15d7fcf49767faedc72b483-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
@sereneinserenade/tiptap-search-and-replace
Advanced tools
Search and Replace extension for Tiptap 2. Published to npm as @sereneinserenade/tiptap-extension-search-n-replace.
A ⭐️ to the repo if you 👍 / ❤️ what I'm doing would be much appreciated. If you're using this extension and making money from it, it'd be very kind of you to :heart: Sponsor me. If you're looking for a dev to work you on your project's Rich Text Editor with or as a frontend developer, DM me on Discord/Twitter/LinkedIn👨💻🤩.
I've made a bunch of extensions for Tiptap 2, some of them are Google Docs like Commenting, Resize image and Videos, LanguageTool integration with tiptap. You can check it our here https://github.com/sereneinserenade#a-glance-of-my-projects .
Try it out live at https://sereneinserenade.github.io/tiptap-search-n-replace-demo, and/or take a look at a demo-video below.
Note: npm version is not up-to-date. Just copy paste the extension in your code and it should work
Ideally you should keep track of these states in your code, but if you absolutely need to read the searchTerm
and replaceTerm
from extension, here's the code.
const searchTerm: string = editor.storage.searchAndReplace.searchTerm
const replaceTerm: string = editor.storage.searchAndReplace.replaceTerm
I've published it as an npm package so you can either directly install it,
npm i @sereneinserenade/tiptap-search-and-replace
yarn add @sereneinserenade/tiptap-search-and-replace
import { Editor } from "@tiptap/core";
import { SearchNReplace } from "./path/to/search-n-replace.ts/";
const editor = new Editor({
content: "<p>Example Text</p>",
extensions: [
SearchNReplace.configure({
searchResultClass: "search-result", // class to give to found items. default 'search-result'
caseSensitive: false, // no need to explain
disableRegex: false, // also no need to explain
}),
],
});
const searchTerm = ref<string>("replace");
const replaceTerm = ref<string>("astonishing");
// you can use the commands provided by SearchNReplace extension to update the values of search and replace terms.
const updateSearchReplace = () => {
if (!editor.value) return;
editor.value.commands.setSearchTerm(searchTerm.value);
editor.value.commands.setReplaceTerm(replaceTerm.value);
};
import { Editor } from "@tiptap/core";
import { SearchNReplace } from "./path/to/search-n-replace.ts/";
const editor = new Editor({
content: "<p>Example Text</p>",
extensions: [
SearchNReplace.configure({
searchResultClass: "search-result", // class to give to found items. default 'search-result'
caseSensitive: false, // no need to explain
disableRegex: false, // also no need to explain
}),
],
});
const searchTerm = useState<string>("replace");
const replaceTerm = useState<string>("astonishing");
// you can use the commands provided by SearchNReplace extension to update the values of search and replace terms.
const updateSearchReplace = () => { // you can probably use `useCallback` hook)
if (!editor.value) return;
editor.value.commands.setSearchTerm(searchTerm.value);
editor.value.commands.setReplaceTerm(replaceTerm.value);
};
Show your ❤️ by ⭐️ing this repository! It means a lot.
Clone the repo, do something, make a PR(or not). You know what's the drill. Looking forward to your PRs, you amazing devs.
This template should help get you started developing with Vue 3 in Vite. The template uses Vue 3 <script setup>
SFCs, check out the script setup docs to learn more.
FAQs
Tiptap Extension for adding comments
The npm package @sereneinserenade/tiptap-search-and-replace receives a total of 629 weekly downloads. As such, @sereneinserenade/tiptap-search-and-replace popularity was classified as not popular.
We found that @sereneinserenade/tiptap-search-and-replace demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.