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

Preserve links on export/import #14

Open
vasylOstrovskyi opened this issue Oct 24, 2020 · 9 comments
Open

Preserve links on export/import #14

vasylOstrovskyi opened this issue Oct 24, 2020 · 9 comments

Comments

@vasylOstrovskyi
Copy link

All links are lost when exporting to html or any other format. Also, it would be great to restore them during import of saved document.
I am absulute dummy in node and js, but looking at the export code I noticed that there is some hook which enables including extra tags into exported html, so this must not be extremely complicated to do.
Regards,
Vasyl

@LeaChemoul
Copy link

I have the same problem and that's really problematic if you want to :

  • export/import HTML as @vasylOstrovskyi said
  • come back to another version
  • copy paste links inside a pad
  • copy paste links from a pad to another one
  • setHtml of a pad with an external html text (in my case i want to set default pad text with some html and it contains links like : <a href="http://google.com">Google</a>)

I've created a workaround to export my links from etherpad. Maybe that's not the best way but some people may find it useful:

exports.getLineHTMLForExport = async (hookName, context) => {
    const content = $('<div>').html(context.lineContent);
    content.find('span').each(function () {
        const span = $(this);
        const url = span.data('url');
        if (!url) return; // not a url
        span.replaceWith(
            $('<a>').attr('href', `${url}`).text(span.text()));
    });
    context.lineContent = content.html();
};

I couldn't find how to preserve external links on setHtml or to copy paste it.
I would really appreciate some information @seballot, since i need it for my production environment to work.

Best regards

@seballot
Copy link
Collaborator

Hi @LeaChemoul, I did not write this plugin, I just took the maintenance cause I improved the UI, so sorry but I have no more information than you have...

@tiblu
Copy link
Member

tiblu commented Feb 9, 2022

@seballot Thanks for your work so far!

Are you planning to actively maintain this project? Asking cause we're (Citizen OS - https://github.com/citizenos/) interested in a hyperlink plugin.

I THINK this plugin needs a sizeable rewrite to support toolbar configuration, exports etc. So we're thinking if we are going to create a brand new plugin or PR this project. IF you lack time to maintain, which is perfectly understandable, we would like to take ownership of the project OR create a brand new plugin just to speed up the development and release cycle.

Related to: citizenos/citizenos-fe#110

@seballot
Copy link
Collaborator

seballot commented Feb 9, 2022

hi @tiblu

I can defintly give you the ownership, should I transfer it to citizenos ?

@tiblu
Copy link
Member

tiblu commented Feb 9, 2022 via email

@seballot
Copy link
Collaborator

seballot commented Feb 9, 2022

ok no prob. But you need to delete the fork on citizenos so I can transfer you the ownership

@seballot
Copy link
Collaborator

seballot commented Feb 9, 2022

for npm I have invited citizenos-owner as a maintainer

@tiblu
Copy link
Member

tiblu commented Feb 9, 2022

ok no prob. But you need to delete the fork on citizenos so I can transfer you the ownership

@seballot Fork deleted.

for npm I have invited citizenos-owner as a maintainer

Thank you!

@seballot
Copy link
Collaborator

seballot commented Feb 9, 2022

still not working for citizenos, as it's an organization I needed the proper right to transfer, so I transfered it to you and you will be able to transfer again
have fun, bye !

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

No branches or pull requests

4 participants