[p2pu-dev] jsFiddle and Syntax Highlighting
dandiebolt at gmail.com
Fri Sep 16 16:55:44 UTC 2011
I am fairly certain that the problem with the jsFiddle embed is in the
regular expression matching embedly uses to parse the ebmeded url. jsFiddle
URLs can have a wide range of forms as they communicate the configuration of
the fiddle using extra url paths. As a preliminary investigation I sent an
inquiry to the jsFiddle mailing list and perhaps Zalun et al will come up
with an answer. Then I will contact embed.ly and hopefully they will get
jsFiddle on the provider list.
A platform I work with (p2pu.org) has attempted to use embed.ly to come up
with a shortcode to embed jsFiddles into their platofrm via their
configuration of CKEditor. Here is an example of the embed shortcode that
Although jsFiddle is not on Embedly's provider list
various forms of the jsFiddle URL do embed. I am not sure why that happens
but I suspect that the reason it does not embed in other cases is because
they are using a overly simplified regular expression to match jsFiddle
URLs. These details may not be to interesting to you but I would like to
pose the independent question as to what regular expression does match a
jsFiddle URL taking into account all the features a jsFiddle may have:
- anonymous fiddles (no user)
- characters encoding the jsFiddle ID
- jsFiddle versions
- default embed with no tabs specified
- embed with tabs specified.
Here is my crude attempt to write a regexp for a jsFiddle URL with various
capturing parentheses tossed in:
I have no idea what characters are allowed for the jsFiddle ID or user names
so I just specified alphanumerics. Also I overlooked version numbers, &
dependancies when I typed this regexp. Moreover I never tested it.
So if someone wants a challenge I would like to find the regexp that matches
all jsFiddle URLs without getting too anal. The key area is focus on is the
embedded path which can contain tabs (and you apparently can list a tab
twice) because the whole goal of embedly is to embed the jsFiddle URL in an
iframe on blog or cms.
My overall goal is to get embed.ly to support jsFiddle embeds and I will
bird dog that issue but it would be a nice piece of information to have a
regexp for matching any jsFiddle.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the p2pu-dev