question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Nested blocks, for extracting links💡

See original GitHub issue

This looks like an amazing tool! We are investigating removing our TinyMCE editor from our CMS and are interested in using your project.

If our editors add links to resources on the web, we would like to be able to identify if these items still exist or if they are redirecting, so we can update/remove the links. Currently, with TinyMCE, this is really difficult.

I love the way the data is presented and would be amazing for us, but I was wondering if you can or plan to have nested blocks? Or if it’s already supported. If an editor adds an inline link into a paragraph, is it possible to have this as a nested block?

Currently this is how your editor outputs a paragraph:

   {
            "type" : "paragraph",
            "data" : {
                "text" : "There are dozens of <a href=\"https://github.com/editor-js\">ready-to-use Blocks</a> and the <a href=\"https://editorjs.io/creating-a-block-tool\">simple API</a> for creation any Block you need. For example, you can implement Blocks for Tweets, Instagram posts, surveys and polls, CTA-buttons and even games."
            }
        },

Possible future:

{
  "type": "paragraph",
  "data": [
    {
      "text": "There are dozens of "
    },
    {
      "link": {
        "url": "https://github.com/editor-js",
        "text": "ready-to-use Blocks"
      }
    }
    {
      "text": " and the "
    },
    {
      "link": {
        "url": "https://editorjs.io/creating-a-block-tool",
        "text": "simple API"
      }
    },
    {
      "text": " for creation any Block you need. For example, you can implement Blocks for Tweets, Instagram posts, surveys and polls, CTA-buttons and even games."
    }
  ]
}

Looks like the paragraph tool is a plugin so we would be able to write and share our own version, but would this allow us to create our own custom data? And would this be something you are interested in supporting?

Thanks for your time.

And again this is an amazing project!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:16
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
webdebcommented, Jun 11, 2020

I think my issue is related to this / could be fixed with the proposed solution: When you press Shift + Enter while editing a paragraph, an <br> is added. I would expect just a new-line \n. or with the proposed structure:

type: "paragraph",
data: [
  { text: "Hello", styles: ["bold"] },
  { text: "World", styles: ["bold", "italic"] },
  { text: "!", styles: ["bold"] },
  { type: "line-break"},
  { text: "more text..."},
]

Yes, its a lot of data, but:

The Quote from the base-concepts page:

What is clean data … Editor.js returns clean data instead of HTML-markup

2reactions
winston0410commented, Jun 7, 2020

Same here. Looking forward for nested block.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Nested Blocks: Using InnerBlocks | Block Editor Handbook
You can create a single block that nests other blocks using the InnerBlocks component. This is used in the Columns block, Social Links...
Read more >
Nested Links - CSS-Tricks
The nested link gets kicked out. My first inclination would be to simply not nest the links in the markup, but make them...
Read more >
Data Extraction - Documentation - ScrapingBee
Extract all links from a page. For SEO purposes, lead generation, or simply data harvesting it can be useful to quickly extract all...
Read more >
mixin and @include - Sass
Overview; Passing Arguments to Content Blocks. Indented Mixin Syntax. Mixins allow you to define styles that can be re-used throughout your stylesheet.
Read more >
Blocks - ACF
A graphic showing an ACF Block with an inset code editor showing block.json content. Simplified example of registering a custom testimonial block. Link...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found