Git Product home page Git Product logo

Comments (5)

JiuqingSong avatar JiuqingSong commented on July 28, 2024

Can you provide more details, such as the source HTML, the related content model you expect? For now I'm not quite understand the requirement.

from roosterjs.

Geoffsc avatar Geoffsc commented on July 28, 2024

@JiuqingSong thanks for your response. I think ideally the feature might work something like this:

  • The user highlights some text towards the bottom of the editor
  • The user clicks an "Anchor" button with options "insert Anchor" or "remove Anchor". Insert Anchor has a field to enter the anchor id. If the user doesn't enter anything in the field and clicks ok, nothing in the html changes (similar to if you don't enter a URL for the hyperlink button).
  • When insert anchor is clicked, the text is then wrapped in an anchor tag like:
    <a id="Heading1"</a>
  • User can then highlight text above the anchored text and click an "anchor link" button
    image
    Which wraps that text in an anchor hyperlink:
    <a href="#Heading1">Heading 1</a>

That way the user can create as many of these anchor ids and corresponding anchor links as they wish to create a Table of Contents at the top of the editor, which links to the corresponding sections below.

from roosterjs.

JiuqingSong avatar JiuqingSong commented on July 28, 2024

I see. Actually you mean something like <a name="..."> rather than <a id="..."> right?

from roosterjs.

Geoffsc avatar Geoffsc commented on July 28, 2024

I see. Actually you mean something like <a name="..."> rather than <a id="..."> right?

I think that should work!

from roosterjs.

JiuqingSong avatar JiuqingSong commented on July 28, 2024

This can be done by creating your own format parser for link and store the name property, and write it back when create DOM tree.

Then for the input dialog, you can do it in your own code.

from roosterjs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.