CKEDITOR.plugins.pastetools.filters.common.rtf
class
Filtering
Methods
since 4.16.0 private
extractGroupContent( group ) → StringCKEDITOR.plugins.pastetools.filters.common.rtf#extractGroupContentGet group content.
The content starts with the first character that is not a part of control word or subgroup.
var group = '{\\group{\\subgroup subgroupcontent} group content}', groupContent = CKEDITOR.plugins.pastetools.filters.common.rtf.extractGroupContent( group ); console.log( groupContent ); // "group content"Parameters
group : StringWhole group string.
Returns
StringExtracted group content.
since 4.16.0 private
getGroup( content, groupName, options ) → GroupInfoCKEDITOR.plugins.pastetools.filters.common.rtf#getGroupGet the group from the RTF content with the given name.
Groups are recognized thanks to being in
{\<name>}format.var rtfContent = '{\\rtf1\\some\\control\\words{\\group content1}{\\group content2}{\\whatever {\\subgroup content}}}', firstGroup = CKEDITOR.plugins.pastetools.filters.common.rtf.getGroup( rtfContent, '(group|whatever)' ), lastGroup = CKEDITOR.plugins.pastetools.filters.common.rtf.getGroup( rtfContent, '(group|whatever)', { start: 50 } ); console.log( firstGroup ); // {"start":25,"end":42,"content":"{\\group content1}"} console.log( lastGroup ); // {"start":59,"end":90,"content":"{\\whatever {\\subgroup content}}"}Parameters
content : StringRTF content.
groupName : StringGroup name to find. It can be a regex-like string.
options : ObjectAdditional options.
Returns
GroupInfo
since 4.16.0 private
getGroups( rtfContent, groupName ) → GroupInfo[]CKEDITOR.plugins.pastetools.filters.common.rtf#getGroupsGet all groups from the RTF content with the given name.
var rtfContent = '{\\rtf1\\some\\control\\words{\\group content}{\\group content}{\\whatever {\\subgroup content}}}', groups = CKEDITOR.plugins.pastetools.filters.common.rtf.getGroups( rtfContent, '(group|whatever)' ); console.log( groups ); // Result of the console.log: // [ // {"start":25,"end":41,"content":"{\\group content}"}, // {"start":41,"end":57,"content":"{\\group content}"}, // {"start":57,"end":88,"content":"{\\whatever {\\subgroup content}}"} // ]Parameters
rtfContent : StringgroupName : StringGroup name to find. It can be a regex-like string.
Returns
GroupInfo[]
since 4.16.0 private
removeGroups( rtfContent, groupName ) → StringCKEDITOR.plugins.pastetools.filters.common.rtf#removeGroupsRemove all groups from the RTF content with the given name.
var rtfContent = '{\\rtf1\\some\\control\\words{\\group content}{\\group content}{\\whatever {\\subgroup content}}}', rtfWithoutGroups = CKEDITOR.plugins.pastetools.filters.common.rtf.removeGroups( rtfContent, '(group|whatever)' ); console.log( rtfWithoutGroups ); // {\rtf1\some\control\words}Parameters
rtfContent : StringgroupName : StringGroup name to find. It can be a regex-like string.
Returns
StringRTF content without the removed groups.