当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript katamari.Unicode类代码示例

本文整理汇总了TypeScript中@ephox/katamari.Unicode的典型用法代码示例。如果您正苦于以下问题:TypeScript Unicode类的具体用法?TypeScript Unicode怎么用?TypeScript Unicode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Unicode类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1:

 spot.each((s) => {
   if (s.node.data.charAt(s.offset - 1) === Unicode.zeroWidth()) {
     s.node.deleteData(s.offset - 1, 1);
     if (editor.dom.isEmpty(s.node.parentNode)) {
       editor.dom.remove(s.node.parentNode);
     }
   }
 });
开发者ID:tinymce,项目名称:tinymce,代码行数:8,代码来源:KeyHandler.ts

示例2: applyInlinePatterns

 () => {
   // create a cursor position that we can move to avoid the inline formats
   editor.insertContent(Unicode.zeroWidth());
   applyInlinePatterns(editor, inlineAreas);
   blockArea.each((pattern) => applyBlockPattern(editor, pattern));
   // find the spot before the cursor position
   const range = editor.selection.getRng();
   const block = editor.dom.getParent(range.startContainer, editor.dom.isBlock);
   const spot = textBefore(range.startContainer, range.startOffset, block);
   editor.execCommand('mceInsertNewLine');
   // clean up the cursor position we used to preserve the format
   spot.each((s) => {
     if (s.node.data.charAt(s.offset - 1) === Unicode.zeroWidth()) {
       s.node.deleteData(s.offset - 1, 1);
       if (editor.dom.isEmpty(s.node.parentNode)) {
         editor.dom.remove(s.node.parentNode);
       }
     }
   });
 }
开发者ID:tinymce,项目名称:tinymce,代码行数:20,代码来源:KeyHandler.ts

示例3:

const isZeroWidth = (elem): boolean => {
  // TODO: I believe this is the same cursor used in tinymce (Unicode.zeroWidth)?
  return Node.isText(elem) && Text.get(elem) === Unicode.zeroWidth();
};
开发者ID:tinymce,项目名称:tinymce,代码行数:4,代码来源:AnnotationContext.ts


注:本文中的@ephox/katamari.Unicode类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。