No internet connection
  1. Home
  2. Support

Potential bug: Pasting code gives error about having too many links

By Christian Scheuer @chrscheuer
    2020-01-06 19:04:01.332Z

    Hi @KajMagnus

    See Jon's input here:

    He can't paste code to our forum. Do you have any idea why it would think that these are links?
    He also tried pasting the code inside ``` lines to no avail.

    • 6 replies
    1. Ok that's an anti spam thing. Apparently it's too restrictive (at least in this case). I'll look into this tomorrow

      1. Progress
      2. KajMagnus @KajMagnus2020-01-25 13:21:44.669Z2020-01-25 14:31:33.923Z

        I looked into this now. Sorry it took a while.

        I cannot reproduce. When I add ``` backticks, link looking things and <a href=...> etc won't get converted to links, and I can submit "lots of" links, no problem (when that number of links is otherwise disallowed).

        I'm wondering if this is instead a UX problem. When your user, Jon, attempted to add the ``` backticks, I'm guessing he did that in the wrong way somehow, maybe added the ``` on the wrong line or only two ticks or something.

        Anwyay, it's not so user friendly, by Talkyard, to require people to know about backticks ```, or require them to remove some links.

        Maybe Talkyard can instead simply just not convert all link looking things to real <a href=.... links. Only the first 5 links, if it's a new user, and maybe the first 20 if s/he is a basic / full member. (Because what happened in Jon's case, was that lots of not-actually-links source code words got converted to links, by Linkify-it, resulting in too many links.) — Remaining links, could stay plain text instead, no html markup added.

        At the same time, maybe this isn't a good way to mitigate spam, at all. Hmm. But Talkyard checks links with external services like Google Safe Browsing API, and if new users can post 999 links, then maybe Talkyard would exceed some rate limits. — Probably some max number of links is a good idea. Hmm

        Edit: Now I posted a thought about this, over at the Linkify-It forum: "What about a setting: Max num links to linkify?"

        1. Related issue: Issue with formatting of code when using the upsert API — Markdown formatting was ignored, when using the Upsert API.

          I wonder if maybe that was what happened here.

          (since I couldn't reproduce, but for Jon it happened consistently, which would have been the case, if he was posting via the Upsert API)

          1. C
            Christian Scheuer @chrscheuer
              2020-06-20 19:42:30.742Zreplies toKajMagnus:

              Hm, I just lost a draft here when clicking to edit it.. Anyway was gonna say that I think in that case Jon was using the forum on the website so not via the Upsert API, so I believe it must have been a different bug.

              1. Ok, thanks, good to know. (Lost a draft? There was a draft visible in the page, and when clicking to edit, the text was gone?)

                1. C
                  Christian Scheuer @chrscheuer
                    2020-06-20 20:18:38.796Zreplies toKajMagnus:

                    Yes exactly :)