{"id":16294762,"url":"https://github.com/finesse/froala-editor-paragraph-format-extended-plugin","last_synced_at":"2025-04-09T12:47:27.019Z","repository":{"id":57241901,"uuid":"57960819","full_name":"Finesse/froala-editor-paragraph-format-extended-plugin","owner":"Finesse","description":"A plugin for Froala Editor 2 that allows to choose paragraph format (tag name, class, etc.) from a list","archived":false,"fork":false,"pushed_at":"2019-06-24T12:42:05.000Z","size":86,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-23T09:51:15.028Z","etag":null,"topics":["format","froala-editor","paragraph","plugin","style","text"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Finesse.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-05-03T10:23:12.000Z","updated_at":"2022-10-26T19:45:30.000Z","dependencies_parsed_at":"2022-09-15T08:51:16.480Z","dependency_job_id":null,"html_url":"https://github.com/Finesse/froala-editor-paragraph-format-extended-plugin","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Finesse%2Ffroala-editor-paragraph-format-extended-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Finesse%2Ffroala-editor-paragraph-format-extended-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Finesse%2Ffroala-editor-paragraph-format-extended-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Finesse%2Ffroala-editor-paragraph-format-extended-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Finesse","download_url":"https://codeload.github.com/Finesse/froala-editor-paragraph-format-extended-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248045221,"owners_count":21038553,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["format","froala-editor","paragraph","plugin","style","text"],"created_at":"2024-10-10T20:16:26.425Z","updated_at":"2025-04-09T12:47:26.997Z","avatar_url":"https://github.com/Finesse.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [Froala Editor](http://github.com/froala/wysiwyg-editor/) Paragraph Format Extended plugin\n\n[![npm](https://img.shields.io/npm/v/froala-editor-paragraph-format-extended-plugin.svg)](https://www.npmjs.com/package/froala-editor-paragraph-format-extended-plugin)\n![Supported Froala Editor versions](https://img.shields.io/badge/Froala_Editor-v3-brightgreen.svg)\n[![Gzip size](https://badgen.net/bundlephobia/minzip/froala-editor-paragraph-format-extended-plugin?color=green)](https://bundlephobia.com/result?p=froala-editor-paragraph-format-extended-plugin)\n\nA plugin for Froala WYSIWYG Editor v3 that allows to choose paragraph format (tag name, \nclass, etc.) from a list. It is like a mixture of the `paragraphFormat` and the `paragraphStyle` plugins with some \nextended features.\n\nIf you need a plugin for Froala Editor v2, use [version 0.1](http://github.com/Finesse/froala-editor-paragraph-format-extended-plugin/tree/froala-v2).\nIt won't get new features.\n\n\n## Status\n\n[![Build Status](https://travis-ci.org/Finesse/froala-editor-paragraph-format-extended-plugin.svg?branch=master)](https://travis-ci.org/Finesse/froala-editor-paragraph-format-extended-plugin)\n[![dependencies Status](https://david-dm.org/Finesse/froala-editor-paragraph-format-extended-plugin/status.svg)](https://david-dm.org/Finesse/froala-editor-paragraph-format-extended-plugin)\n[![devDependencies Status](https://david-dm.org/Finesse/froala-editor-paragraph-format-extended-plugin/dev-status.svg)](https://david-dm.org/Finesse/froala-editor-paragraph-format-extended-plugin?type=dev)\n[![peerDependencies Status](https://david-dm.org/Finesse/froala-editor-paragraph-format-extended-plugin/peer-status.svg)](https://david-dm.org/Finesse/froala-editor-paragraph-format-extended-plugin?type=peer)\n\n\n## Installation\n\nThere are several ways to install the plugin:\n\n\u003cdetails open\u003e\n\u003csummary\u003eSimple\u003c/summary\u003e\n\nDownload the [plugin script](dist/paragraph_format_extended.umd.min.js) and import it using a `\u003cscript\u003e` tag after the \nFroala Editor import.\n\n```html\n\u003c!-- Froala Editor required stuff --\u003e\n\u003clink href=\"//cdn.jsdelivr.net/npm/froala-editor@3.0/css/froala_editor.css\" rel=\"stylesheet\" type=\"text/css\" /\u003e\n\u003clink href=\"//cdn.jsdelivr.net/npm/froala-editor@3.0/css/froala_style.css\" rel=\"stylesheet\" type=\"text/css\" /\u003e\n\u003cscript src=\"//cdn.jsdelivr.net/npm/froala-editor@3.0/js/froala_editor.min.js\"\u003e\u003c/script\u003e\n\n\u003c!-- Paragraph Format Extended plugin --\u003e\n\u003cscript src=\"//cdn.jsdelivr.net/npm/froala-editor-paragraph-format-extended-plugin@0.2/dist/paragraph_format_extended.umd.min.js\"\u003e\u003c/script\u003e\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eAMD/RequireJS\u003c/summary\u003e\n\nThe script requires the following AMD modules to be available:\n\n* `froala-editor` — the Froala Editor main script.\n\nInstallation:\n\n```js\nrequire.config({\n  paths: {\n    'froala-editor': '//cdn.jsdelivr.net/npm/froala-editor@3.0/js/froala_editor.min',\n    'froala-editor-paragraph-format-extended-plugin': '//cdn.jsdelivr.net/npm/froala-editor-paragraph-format-extended-plugin@0.2/dist/paragraph_format_extended.umd.min'\n  }\n});\n\ndefine('myModule', ['froala-editor', 'froala-editor-paragraph-format-extended-plugin'], function (FroalaEditor) {\n  // ...\n});\n```\n\nYou can find more information about installation of Froala Editor using AMD in [the editor readme](http://github.com/froala/wysiwyg-editor#load-from-cdn-as-an-amd-module).\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eNode.js/NPM/Yarn/Webpack/Rollup/Browserify\u003c/summary\u003e\n\nInstall the plugin:\n\n```bash\nnpm install froala-editor-paragraph-format-extended-plugin --save\n```\n\nRequire it:\n\n```js\nconst FroalaEditor = require('froala-editor');\nrequire('froala-editor-paragraph-format-extended-plugin');\n```\n\u003c/details\u003e\n\n## Basic usage\n\nCreate an editor, add a `paragraphFormatExtended` button to the toolbar and set up the formats list:\n\n```html\n\u003cdiv id=\"editor\"\u003e\u003c/div\u003e\n```\n```js\nnew FroalaEditor({\n  toolbarButtons: [/* Other your buttons... */ 'paragraphFormatExtended'],\n  paragraphFormatExtended: [\n    {title: 'Normal'},\n    {tag: 'h1', title: 'Heading 1'},\n    {tag: 'h2', title: 'Heading 2'},\n    {tag: 'h2', 'class': 'fr-text-bordered', title: 'Header 2 bordered'},\n    {tag: 'pre', id: 'code', title: 'Code'}\n  ]    \n});\n```\n\n## Reference\n\nThe name of the toolbar button of this plugin is `paragraphFormatExtended`.\n\nWhen a paragraph format is changed by the user via the dropdown, the `class` and `id` attributes of the selected \nparagraphs are purged and replaced with the chosen format values even if they are not set.\n\n### Options\n\n#### paragraphFormatExtended\n\n**Type**: `Array`\n\n**Default value:**\n\n```js\n[\n  {title: 'Normal'},\n  {tag: 'h1', title: 'Heading 1'},\n  {tag: 'h2', title: 'Heading 2'},\n  {tag: 'h3', title: 'Heading 3'},\n  {tag: 'h4', title: 'Heading 4'},\n  {tag: 'h4', 'class': 'fr-text-bordered', title: 'Header 4 bordered'},\n  {tag: 'pre', title: 'Code'}\n]\n```\n\nA list with the formats that will appear in the Paragraph Format Extended dropdown from the toolbar. Array items are \nobjects with the following attributes:\n\n* `title` (String, required) — Format title that is shown in the dropdown. It is [translated by Froala Editor](http://froala.com/wysiwyg-editor/docs/methods#language.translate) before displaying.\n* `tag` (String|Null) — Paragraph tag name. If `null` or nothing is provided the default editor tag is used.\n* `class` (String|Null) — Paragraph CSS class name. May contain multiple classes devided by space.\n* `id` (String|Null) — The value of paragraph `id` HTML attribute.\n\n#### paragraphFormatExtendedSelection\n\n**Type**: `Boolean`\n\n**Default value:** `false`\n\nShould the Paragraph Format Extended button from the toolbar be replaced with a dropdown showing the actual paragraph format name for the current text selection.\n\n### Building\n\nThe source code is located in the `src` directory. Do the following to modify and compile it:\n\n1. Install [node.js](https://nodejs.org/) version 8 or greater.\n2. Open a console, go to the project root directory and run `npm install`.\n3. Run `npm run build` to compile distribution files from the source files.\n\n### Testing\n\nBuild the source code, open the [index.html](index.html) file in a browser and test it manually.\n\nRebuild the source code and reload the browser page manually when you change the source code. \n\n\n## Versions compatibility\n\nThe project follows the [Semantic Versioning](http://semver.org).\n\n\n## License\n\nThis package is available under MIT License. However, in order to use Froala WYSIWYG HTML Editor plugin you should purchase a license for it.\n\nSee https://froala.com/wysiwyg-editor/pricing for licensing the Froala Editor.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffinesse%2Ffroala-editor-paragraph-format-extended-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffinesse%2Ffroala-editor-paragraph-format-extended-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffinesse%2Ffroala-editor-paragraph-format-extended-plugin/lists"}