Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
quill-mention
Advanced tools
Quill Mention is a module to provide @mentions functionality for the Quill rich text editor.
https://afconsult.github.io/quill-mention/
Install with npm:
npm install quill-mention --save
Install with Yarn:
yarn add quill-mention
const values = [
{ id: 1, value: 'Fredrik Sundqvist' },
{ id: 2, value: 'Patrik Sjölin' }
];
const quill = new Quill(editor, {
modules: {
mention: {
allowedChars: /^[A-Za-z\sÅÄÖåäö]*$/,
source: function (searchTerm) {
if (searchTerm.length === 0) {
this.renderList(values, searchTerm);
} else {
const matches = [];
for (i = 0; i < values.length; i++)
if (~values[i].value.toLowerCase().indexOf(searchTerm)) matches.push(values[i]);
this.renderList(matches, searchTerm);
}
},
},
}
});
Property | Default | Description |
---|---|---|
source(searchTerm) | null | Required callback function to handle the search term and connect it to a data source for matches. The data source can be a local source or an AJAX request. The callback should call this.renderList(matches, searchTerm); with matches of JSON Objects in an array to show the result for the user. The JSON Objects should have id and value but can also have other values to be used in renderItem for custom display. |
renderItem(item) | function | A function that gives you control over how each matches from source are displayed. |
allowedChars | [a-zA-Z0-9_] | Allowed characters in search term triggering a search request using regular expressions |
minChars | 0 | Minimum number of characters after the @ symbol triggering a search request |
maxChars | 31 | Maximum number of characters after the @ symbol triggering a search request |
Fredrik Sundqvist (MadSpindel)
See also the list of contributors who participated in this project.
This project is licensed under the MIT License - see the LICENSE file for details
FAQs
@mentions for the Quill rich text editor
The npm package quill-mention receives a total of 0 weekly downloads. As such, quill-mention popularity was classified as not popular.
We found that quill-mention demonstrated a healthy version release cadence and project activity because the last version was released less than 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
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.