Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No value supplied for attribute px - FontSize Extension Bug #395

Open
Arturokin opened this issue Sep 7, 2021 · 3 comments
Open

No value supplied for attribute px - FontSize Extension Bug #395

Arturokin opened this issue Sep 7, 2021 · 3 comments
Labels

Comments

@Arturokin
Copy link

Describe the bug
Copying and paste text from word/powerpoint fires bug while using the FontSize extension, if you take out this extension the bug is gone

To Reproduce
Forked the demo page on codesandbox
Steps to reproduce the behavior:

  1. Go to https://codesandbox.io/s/element-tiptap-fontsize-extension-bug-e8oxc?file=/src/components/Editor.vue
  2. Paste text from word or powerpoint into the editor

Expected behavior
Console error throwing: No value supplied for attribute px

@Arturokin Arturokin added the bug label Sep 7, 2021
biblioclasta pushed a commit to biblioclasta/element-tiptap that referenced this issue Sep 28, 2021
Add more unit to font_size and addres issues Leecason#395 and  Leecason#327
@Melussa
Copy link

Melussa commented Oct 13, 2022

同问这个问题~~。复制粘贴会报错

@Liuxiang15
Copy link

同问,复制粘贴在线文档里的内容会报错
"element-tiptap": "^1.26.2"
增加了fontSizes 参数保证复制粘贴的字号在内也无效
new FontSize({
fontSizes: ['8', '10', ...]
});

@codeLittleNewbie
Copy link

/**
   * @title 如果要使用FontSize 需要修改源码 node_modules\prosemirror-model\dist\index
   * function computeAttrs(attrs, value) {
   *   let built = Object.create(null);
   *     for (let name in attrs) {
   *         let given = value && value[name];
   *         if (given === undefined) {
   *             let attr = attrs[name];
   *             if (attr.hasDefault)
   *                 given = attr.default;
   *             else {
   *               console.warn("No value supplied for attribute " + name);
   *               // throw new Warning("No value supplied for attribute " + name);
   *               return built;
   *             }
   *         }
   *         built[name] = given;
   *     }
   *   return built;
   * }
   */

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants