citizenos / ep_embedded_hyperlinks2

Etherpad plugin to embed hyperlinks within a pad
5 stars 8 forks source link

Preserve links on export/import #14

Open vasylOstrovskyi opened 4 years ago

vasylOstrovskyi commented 4 years ago

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 commented 3 years ago

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

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 commented 3 years ago

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 commented 2 years ago

@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: https://github.com/citizenos/citizenos-fe/issues/110

seballot commented 2 years ago

hi @tiblu

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

tiblu commented 2 years ago

Yes, citizenos would be great. Can you do the same for NPM?

All the best and thanks for work!

On Wed, 9 Feb 2022, 19:00 Sebastian Castro, @.***> wrote:

hi @tiblu https://github.com/tiblu

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

— Reply to this email directly, view it on GitHub https://github.com/seballot/ep_embedded_hyperlinks2/issues/14#issuecomment-1033984451, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABYP6RYHUGNL6FXAPDO5XPLU2KMTXANCNFSM4S5NMXAA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were mentioned.Message ID: @.***>

seballot commented 2 years ago

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

seballot commented 2 years ago

for npm I have invited citizenos-owner as a maintainer

tiblu commented 2 years ago

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 commented 2 years ago

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 !