{"id":13773790,"url":"https://github.com/DennisSuitters/summernote-cleaner","last_synced_at":"2025-05-11T06:31:32.514Z","repository":{"id":37285506,"uuid":"58867682","full_name":"DennisSuitters/summernote-cleaner","owner":"DennisSuitters","description":"Plugin for Summernote that adds a Button and/or Paste functionality for cleaning MS Word Crud from editor text","archived":false,"fork":false,"pushed_at":"2024-05-03T08:24:25.000Z","size":159,"stargazers_count":183,"open_issues_count":6,"forks_count":112,"subscribers_count":19,"default_branch":"master","last_synced_at":"2024-05-03T20:22:52.590Z","etag":null,"topics":["addon","clean","crud","office","plugin","summernote","summernote-plugins","toolbar","word","wysiwyg"],"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/DennisSuitters.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-05-15T14:59:37.000Z","updated_at":"2024-05-03T20:22:57.777Z","dependencies_parsed_at":"2022-07-25T01:16:18.884Z","dependency_job_id":"95782428-4621-49c1-82e6-fa2589e60835","html_url":"https://github.com/DennisSuitters/summernote-cleaner","commit_stats":{"total_commits":102,"total_committers":28,"mean_commits":3.642857142857143,"dds":0.7450980392156863,"last_synced_commit":"adf2f1c638e287c642b2db16c4745849f17dff82"},"previous_names":["studiojunkyard/summernote-cleaner","dennissuitters/summernote-cleaner","diemendesign/summernote-cleaner"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DennisSuitters%2Fsummernote-cleaner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DennisSuitters%2Fsummernote-cleaner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DennisSuitters%2Fsummernote-cleaner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DennisSuitters%2Fsummernote-cleaner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DennisSuitters","download_url":"https://codeload.github.com/DennisSuitters/summernote-cleaner/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224703869,"owners_count":17355710,"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":["addon","clean","crud","office","plugin","summernote","summernote-plugins","toolbar","word","wysiwyg"],"created_at":"2024-08-03T17:01:20.192Z","updated_at":"2024-11-17T09:30:21.408Z","avatar_url":"https://github.com/DennisSuitters.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","Plugins"],"sub_categories":["Formatting"],"readme":"# summernote-cleaner v1.0.9\nA plugin for the [Summernote](https://github.com/summernote/summernote/) WYSIWYG editor.\n\nsummernote-cleaner removes the unnecessary and possibly layout breaking Crud that gets added by MSWord, Open Office, and Libre Office Documents.\n\nThe plugin can function in a couple of different ways. It can have a Toolbar Button which allows the Cleaning of the Editor's Text, or Pasted Text can be Cleaned when Pasted into the Text Editor.\n\nThe plugin can also limit the number of characters, with options to display text and/or HTML count in the status bar area.\n\n# Installation\n\n#### 1. Include JS\n\nInclude the following code after Summernote:\n\n```html\n\u003cscript src=\"summernote-cleaner.js\"\u003e\u003c/script\u003e\n```\n\n#### 2. Supported languages\n\nCurrently available in English!\n\n#### 3. Summernote options\n\n```javascript\n$('.summernote').summernote({\n    toolbar: [\n        ['cleaner',['cleaner']], // The Button\n        ['style',['style']],\n        ['font',['bold','italic','underline','clear']],\n        ['fontname',['fontname']],\n        ['color',['color']],\n        ['para',['ul','ol','paragraph']],\n        ['height',['height']],\n        ['table',['table']],\n        ['insert',['media','link','hr']],\n        ['view',['fullscreen','codeview']],\n        ['help',['help']]\n    ],\n    cleaner: {\n      action: 'both', // both|button|paste 'button' only cleans via toolbar button, 'paste' only clean when pasting content, both does both options.\n      icon: '\u003ci class=\"note-icon\"\u003e\u003csvg xmlns=\"http://www.w3.org/2000/svg\" id=\"libre-paintbrush\" viewBox=\"0 0 14 14\" width=\"14\" height=\"14\"\u003e\u003cpath d=\"m 11.821425,1 q 0.46875,0 0.82031,0.311384 0.35157,0.311384 0.35157,0.780134 0,0.421875 -0.30134,1.01116 -2.22322,4.212054 -3.11384,5.035715 -0.64956,0.609375 -1.45982,0.609375 -0.84375,0 -1.44978,-0.61942 -0.60603,-0.61942 -0.60603,-1.469866 0,-0.857143 0.61608,-1.419643 l 4.27232,-3.877232 Q 11.345985,1 11.821425,1 z m -6.08705,6.924107 q 0.26116,0.508928 0.71317,0.870536 0.45201,0.361607 1.00781,0.508928 l 0.007,0.475447 q 0.0268,1.426339 -0.86719,2.32366 Q 5.700895,13 4.261155,13 q -0.82366,0 -1.45982,-0.311384 -0.63616,-0.311384 -1.0212,-0.853795 -0.38505,-0.54241 -0.57924,-1.225446 -0.1942,-0.683036 -0.1942,-1.473214 0.0469,0.03348 0.27455,0.200893 0.22768,0.16741 0.41518,0.29799 0.1875,0.130581 0.39509,0.24442 0.20759,0.113839 0.30804,0.113839 0.27455,0 0.3683,-0.247767 0.16741,-0.441965 0.38505,-0.753349 0.21763,-0.311383 0.4654,-0.508928 0.24776,-0.197545 0.58928,-0.31808 0.34152,-0.120536 0.68974,-0.170759 0.34821,-0.05022 0.83705,-0.07031 z\"/\u003e\u003c/svg\u003e\u003c/i\u003e',\n      keepHtml: true,\n      keepTagContents: ['span'], //Remove tags and keep the contents\n      badTags: ['applet', 'col', 'colgroup', 'embed', 'noframes', 'noscript', 'script', 'style', 'title', 'meta', 'link', 'head'], //Remove full tags with contents\n      badAttributes: ['bgcolor', 'border', 'height', 'cellpadding', 'cellspacing', 'lang', 'start', 'style', 'valign', 'width', 'data-(.*?)'], //Remove attributes from remaining tags\n      limitChars: 0, // 0|# 0 disables option\n      limitDisplay: 'both', // none|text|html|both\n      limitStop: false, // true/false\n\t  limitType: 'text', // text|html\n      notTimeOut: 850, //time before status message is hidden in miliseconds\n      keepImages: true, // if false replace with imagePlaceholder\n      imagePlaceholder: 'https://via.placeholder.com/200'\n    }\n});\n```\n\n# Documentation\n\n**action:**\nOptions: ( both | button | paste )\n- button = Only cleans via toolbar button.\n- paste = Only cleans when pasting content.\n- both = Does both of the above options.\n\n**keepHtml:**\n- true = Keeps HTML Markup and put through parser to remove Word Crud.\n- false = Removes tag elements using the text version of the pasted content from the clipboard.\n\n**keepTagContents**\nRemoves the tag but keeps the contents, e.g. useful for removing links or spans without losing text content\n\n**badTags:**\nRemove full tags with contents. Tags listed by name only `['style',  'script']`\nNB: any tag not present in keepTagContents or badTags will remain\n\n**badAttributes:**\nRemove attributes from tags. Attributes listed by name only `['style',  'start']`\n\n**limitChars:**\nLimits the number of characters in the summernote\n- false or 0 = allows for max input\n- numbers \u003e 0 = limit on number of characters\n\n**limitDisplay:**\nShows in the status area the total html \u0026 text characters\nOptions: ( text | html | both )\n- text = text character count only\n- html = html character count only\n- both = both html \u0026 text\n\n**limitStop:**\nLimits the number of characters set by limitChars.\n- true = stops input\n- false = doesn't stop input\n\n**limitType**\nDetermines whether the limit is based on the text or html content length. Defaults to text if the option is not provided.\n- text = uses the text content to calculate length for the limit\n- html = uses the html content to calculate length for the limit\n\n**imagePlaceholder:**\nReplace pasted images with a nominated placeholder.\n\n# Thanks:\n- [RichardSquires](https://github.com/RichardSquires)\n  - Several issue regarding parsing text, and updating docs.\n- [wheelspin](https://github.com/wheelspin)\n  - For adding Microsoft Browsers Support, and modifying the alert.\n- [Diemen Design](https://github.com/DiemenDesign/)\n  - Check out our other Summernote Plugins via our main Github page.\n\n# CHANGELOG:\n#### v1.0.9\n- Made image placeholder optional (many thanks to [DuncanHouston](https://github.com/DuncanHouston/))\n#### v1.0.8\n- Resolved issue where text like `\u003casdf\u003e` was accidentally counted as html when pasting from plain text context\n\n#### v1.0.7\n- Resolved issue in some cases where code view would be out of synch with editor\n\n#### v1.0.6\n- Added cleanup of data- attributes\n\n#### v1.0.5\n- Resolved tags/attributes not stripped when over one or more line\n- Resolved spaces disappearing after pasting\n\n#### v1.0.4\n- Resolved sucess status text always shown after action\n\n#### v1.0.3\n- Added feature for removing a tag whilst keeping its content\n\n#### v1.0.2\n- Resolved paste plain text with keepHtml enabled bug\n- Code cleanup\n\n#### V1.0.1\n- Remove keepOnlyTags, and keepClasses, they were origially intended to be used, but refinement and other options have taken their place.\n- Reformat source looking for typos.\n- Replace Images with a nominated placeholder.\n- Replace `alt` attributes with `data-title` and `alt` used by Summernote.\n\n# TODO:\n- Implement Image conversion to base64, and hopefully automatic upload to destination folder.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDennisSuitters%2Fsummernote-cleaner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FDennisSuitters%2Fsummernote-cleaner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDennisSuitters%2Fsummernote-cleaner/lists"}