Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

224
Views
Editor.js: how to add unique block id for each editor element as 'id' attribute?

I use Editor.js in my ReactJS application. Everything perfect except I can't pass unique block id as 'id' attribute.

For example, data is:

{
    "time": 1658299444298,
    "blocks": [
        {
            "id": "sheNwCUP5A",
            "data": {
                "text": "Acceptable Use Policy",
                "level": 2
            },
            "type": "header"
        }
    ],
    "version": "2.25.0"
}

and DOM-tree is

<div class="codex-editor__redactor" style="padding-bottom: 300px;">
  <div class="ce-block">
   <div class="ce-block__content">
    <h2 class="ce-header" contenteditable="false" data-placeholder="">Audit Policy</h2> 
   </div>
  </div>
</div>

To implement anchor links inside current document I need 'id' attribute for each element passed from data.

...
<h2 id="sheNwCUP5A" class="ce-header" contenteditable="false" data-placeholder="">Audit Policy</h2>
...

Any suggestions please?

about 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!