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

Option to embed urls with a special class or a attribute? #15

Closed
qgp9 opened this issue Mar 6, 2016 · 6 comments
Closed

Option to embed urls with a special class or a attribute? #15

qgp9 opened this issue Mar 6, 2016 · 6 comments

Comments

@qgp9
Copy link

qgp9 commented Mar 6, 2016

Hi,

I really love a iframely with nodeBB. I have to say "thank you" first.
But the only problem is that it embed every naked URLs and sometimes it's so messy.

Is it possible I can get a option to specify a class or attribute of link (<a> tag) to embed?
I know in nodeBB, naked URLs doesn't have chance to have a special class or a attribute.
However plugins can do that and my nodebb-plugin-magicblock is one of it.

Actually I'm using my nodeBB with a bittly modified nodebb-plugin-iframely ( just 2 lines so not universal ) but I wish that offical plugin support this.

-QGP9

@qgp9
Copy link
Author

qgp9 commented Mar 7, 2016

Also, if user enables the option, the plugin doesn't need to check if a link is naked or not by https://github.com/NodeBB/nodebb-plugin-iframely/blob/master/library.js#L108-L110

@qgp9
Copy link
Author

qgp9 commented Mar 7, 2016

Hi, I implemented this by myself and check that it's working well.
Here is a comparison of code; master...qgp9:master
Any comments or arguments?

@julianlam
Copy link
Contributor

Hey @qgp9 -- the problem with adding in the option to only allow embeds for links of a certain class, is that it doesn't have any functionality unless it is paired with another plugin...

@qgp9
Copy link
Author

qgp9 commented Mar 7, 2016

@julianlam Yes you are right, but in different of view, it means that iframely can cooperate with other plugin easily in this way :) .
( for example my nodebb-plugin-magicblock or nodebb-plugin-sanitizehtml )
Currently there is no way to control iframely if somebody doesn't want that whole naked links are embeded except a domain filtering.
Specially if somebody who leads a large forum like nodeBB, I can bet that he/she doesn't want to install iframely which will convert every links from old pages, do you? :)

@qgp9
Copy link
Author

qgp9 commented Mar 8, 2016

Hi @julianlam , do we still have a room to discuss or did you make any decision already?
I wish to see this option in an official version and cooperations between plugins, but I also respect any strategy of a development team.
If you think that this option is probably conflicted with any of your strategy/policy/plan/rule then, It's OK, I think I have still other ways to control the iframely independently, even though they are somewhat(quite) tricky :(

@qgp9
Copy link
Author

qgp9 commented Mar 10, 2016

Hi @julianlam, I found and implemented a some hack way to control iframely with current iframely without modifications.
It's some tricky, in short description,

  1. MagicBlock adds <<hackIframely>> at the end of contents of any <a> tag before the iframely plugin.
  2. Then selectively removes this for iframely ( still before iframely )
  3. After iframely plugin, MagicBlock removes all <<hackIframely>>

A Kind of Trick!! :)
But this will work securely before you don't change a priority iframely or a selection algorithms.

So now I close this issues. ( even though I wish to see that option yet :) )

Thanks!

@qgp9 qgp9 closed this as completed Mar 10, 2016
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

2 participants