ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

link parsing seems broken?

October 11, 2011 3:06pm

Subscribe [4]
  • #1 / Oct 11, 2011 3:06pm

    We are seeing a weird error crop up with ExpressionEngine’s autolinking feature, where any link that is a little bit off renders as what looks like BBCode.  I filed a bug on this here but haven’t seen any response yet: https://support.ellislab.com/bugs/detail/16589

    I appear to be able to replicate this on these forums just fine, like this: Google_Link

    Now we are trying to write a plugin that parses URLs when the content of our wysiwyg editor is saved.  It looks like we are getting blocked by this same type of behavior when doing that.  Has anyone seen this behavior before?  Can you replicate by putting a line break in a link?

    I would very much like to know if this is us or a bug in ExpressionEngine.  I haven’t seen this before 2.2.2.

  • #2 / Oct 11, 2011 3:23pm

    jonathanmelville

    132 posts

    Are you using a word processing app (like MS Word) to do your text editing? It looks like you are using fancy quotes in your code which can sometimes mess things up.

  • #3 / Oct 11, 2011 3:52pm

    We often get content copied in from sources such as Word.  However, the quotation marks themselves seem ok.  It definitely seems to be ExpressionEngine doing it.  My student has been searching and says it may have something to do with pmachine-style links?  It works on these forums as well, but so far we can only replicate it by doing a line break in a link.

    this_ will break

    this will not break

  • #4 / Oct 11, 2011 3:56pm

    Just to clarify, these websites were never pmachine sites or even EE 1.x sites.  The installation started with EE 2.x.  We do not yet know what code is causing pmachine-style links to slip into our content.  I do know that they aren’t coming from the database, though - the mysql is clean.

  • #5 / Oct 11, 2011 3:57pm

    jonathanmelville

    132 posts

    Maybe you could try disabling auto XHTML or auto break tags.

    It looks like it’s breaking because EE is automatically inserting a break tag after the line break, so this messes up hyperlinking.

  • #6 / Oct 11, 2011 4:11pm

    The wysiwyg editor field in question has no setting for xhtml/auto/none and doesn’t use one to render to my knowledge.  However, I went into the database and set some of the fields to “none” anyways, and it had no effect on this behavior.

    It’s starting to look like we can’t actually see when regular links are broken (they appear fine) but that they are still messed up if we try to process them in a plugin.  We can see mailto links just fine, though, as referenced in the bug report. 

    EDIT: you CAN see when regular links are broken if you look at the View Entry screen after you hit “Submit”.

    This certainly is a weird issue.  Started just in 2.2.2, although we upgraded from 2.1.0 I believe.

  • #7 / Oct 11, 2011 4:35pm

    What’s really messing us up about this is that if a link is affected, it’s like it comes straight out of the database as a pmachine link, only it’s fine in the database.  I really don’t understand what’s putting all these pmachine-style links into the mix, or at what point this is happening.  I can’t imagine it’s intentional…

  • #8 / Oct 11, 2011 6:51pm

    After some additional testing, it looks like all of our instances of this can be explained by a break in the link.  In addition, the behavior definitely goes away if you uncheck “Automatically turn URLs and email addresses into links?”.  However, we are equally sure that this is new behavior after our latest upgrade.  Can any devs comment on whether this may have been introduced recently?

  • #9 / Oct 12, 2011 12:24am

    John Henry Donovan

    12339 posts

    Hi Dennis,

    What WYSIWYG custom field type are you using?
    Can you only replicate this using this third party fieldtype?

    To me it looks like the behavior is caused by the fieldtype itself.

    Are you happy now that things are working after turning off autolinking?

  • #10 / Oct 12, 2011 8:01am

    We are using a custom wysiwygpro fieldtype.  However, we can replicate this using a plain textarea as well.  I’m afraid turning off autolinking is not a possibility, as we have a TON of client content that we are babysitting with this system.

    I’m not sure why nobody seems to notice that I CAN REPLICATE IT ON THIS FORUM RIGHT HERE WATCH:

    why is this _broken?

    why is this not broken?

    why does this have_ square brackets around it?

    isn’t that bad?

    ^^^all of the above links are a href links!

  • #11 / Oct 12, 2011 8:48am

    jonathanmelville

    132 posts

    View the source of what you just posted where it “broke”. The system has inserted a break tag at the line break, which makes perfect sense…

    If you have a hard return in a line of text, it will make a return for you using a break tag. This break tag has the effect of “breaking” your auto-linking.

    This behavior is normal and not something that I would consider a bug. If you have a line break, it puts a break tag there. Makes sense.

  • #12 / Oct 12, 2011 8:54am

    I totally agree.  However, we are trying to write a plugin that parses links when our wysiwyg content is saved.  The square brackets are showing up if there is a line break - break tags ARE NOT showing up.  WHY are the SQUARE BRACKETS showing up?  That’s not normal.  I can deal with line breaks when processing code but we can’t even parse the a href tags because they are turning into square brackets.  That makes NO sense to do, and so we believe it’s a bug.  Can anyone tell me why those links have square brackets just because we put a line break in them?  Seriously, write an a href link into your post and put a line break in the text and tell me why it shows up with square brackets around it.  If it showed up with only a break tag in it, at least it would STILL BE A LINK.

  • #13 / Oct 12, 2011 2:48pm

    Kevin Smith

    4784 posts

    Hi Dennis,

    Let me see if I understand the problem from your angle: You’re saving links with line-breaks in them in your entries, and you’re not using BBCode, which looks like this:

    [url=http://google.com]This is a link[/url]

    …but rather, you’re trying to use HTML links (with linebreaks) in an entry. You’d like to process these HTML links with a plugin on the front-end, but before you can do so, it appears that EE is converting them to BBCode-style links, complete with line-break and all.

    Is that the situation you’re experiencing? I can confirm this behavior with field formatting set to both “None” and “XHTML”.

    I’m going to ping a dev on this to see what the behavior should be here. I just wanted to make sure I understood the problem as you saw it first. Let me know if I understand you correctly here.

  • #14 / Oct 12, 2011 2:51pm

    That is a pretty good description of the problem as we currently understand it, yes.  Definitely let me know what you find out - thanks!!

  • #15 / Oct 12, 2011 5:27pm

    Robin Sowell

    13255 posts

    Dennis- it’s the Typography class doing it- in system/expressionengine/libraries/EE_Typography.php- search for BBCode to get more detail than you probably want.  For a quick check, set your allowed formatting to ‘all’ and see if that makes a difference.  I’m a little fuzzy on where in the process this is taking place- but it’s definitely what you’re seeing in the forum and very likely what the editor is running into.

    That help clarify what’s going on?

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases