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

116
Views
Seleccione las etiquetas principales en CKeditor javascript

Estoy lidiando con un problema del complemento CKeditor, que desarrollé. Quiero simplemente agregar html personalizado para envolver una lista existente. Sin embargo, cuando intento hacer esto, el texto seleccionado no incluye la etiqueta principal cuando el usuario selecciona la lista. Espero que esto tenga sentido, aquí está mi archivo JS. También quiero seleccionar las etiquetas ul, actualmente solo está seleccionando las etiquetas li.

 /** * @file * Checkbox plugin definition. </div>' */ CKEDITOR.plugins.add("checkbox", { init: function (editor) { "use strict"; editor.addCommand("checkbox_template", { exec: function (editor) { var selectedHtml = ""; var selection = editor.getSelection(); if (selection) { selectedHtml = getSelectionHtml(selection); } editor.insertHtml("<div class=\"checkbox-list\">" + selectedHtml + "</div>"); }, }); editor.ui.addButton("Checkbox", { label: "Checkbox (WYSIWYG)", toolbar: "insert", command: "checkbox_template", icon: this.path + "image/checkbox.jpeg", }); }, }); /** Get HTML of a selection. */ function getSelectionHtml(selection) { var ranges = selection.getRanges(); for (var i = 0; i < ranges.length; i++) { var content = ranges[i].extractContents(); html = content.getHtml(); } return html; }

about 4 years ago · Juan Pablo Isaza
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!