Unable to create poll when the last poll option starts with hashtag

It’s not possible to create polls when the last poll option starts with a #.
@anon36895752 discovered this bug.

This works:

[poll]
- #1
- 2
[/poll]

This doesn’t work:

[poll]
- 1
- #2
[/poll]
5 Likes

Ok but… why should this matter? I agree it is a bug, but … don’t do that? :wink:

It came from an import from an old phpbb3 forum. I had no idea what was crashing the importer script until i started editing files and printing stuff all over the place. I’m fine with the importer just skipping the poll, but hard crashing isn’t a super great solution, especially for people who are new to discourse and are migrating from phpbb and have absolutely no clue where to start looking for the problem.

I agree, the importer shouldn’t crash and I’ll fix that.
But the real issue is that the poll plugin has problems with certain text that looks like markdown.

This has problems too:

[poll]
- 24. November
- 26. November
[/poll]

There’s no problem when the last option doesn’t look like a numbered list:

[poll]
- 24. November
- 26. November
- some other date
[/poll]

Of course, that’s an option. :wink: But I guess documenting the issues is a better solution.

In case someone else stumbles upon the same problems, here’s an easy workaround: Escape the problematic symbols in the poll options by prepending \ to it. The following examples work:

[poll]
- 1
- \#2
[/poll]

[poll]
- 24. November
- 26\. November
[/poll]
5 Likes

Would you mind tagging this topic with poll ?

This is triggering a JavaScript error @tgxworld so it is worth fixing, if possible (at least stop console from filling with errors)

If too hard we can defer on markdown-it-review

4 Likes

Let’s defer it to markdown-it-review, this is a bug in better-markdown.js where the following is generated incorrectly.

5 Likes

Yay this works now:

  • 1
  • #2
0 voters
4 Likes