Fork me on GitHub
Subscribe 4

Ticket #317 (fixed enhancement)

Subscription emails include bbcode

  • Created: 2011-02-23 20:46:04
  • Reported by: Reines
  • Assigned to: FSX
  • Milestone: 1.4.6
  • Component: email
  • Priority: normal

Currently subscription emails include bbcode, which isn't ideal. To solve this we will need to strip out the bbcode tags, leaving only plain text.

History

Franz 2011-02-23 22:03:19

That would suck for quotes, though.

Reines 2011-02-23 22:51:37

I guess we could handle quotes differently, I was just trying to think of a solution that doesn't involve too much work re-implementing the parser with different output.

Reines 2011-03-11 09:21:55

  • Milestone changed from 1.4.5 to 1.4.6.

Reines 2011-04-01 11:10:23

  • Owner Reines removed.

FSX 2011-04-23 10:01:44

  • Owner set to FSX.

Working on this.

Reines 2011-04-23 10:03:43

FYI there is already a bit of code in search_idx that strips out some bbcode, though not sure if it's enough/too much.

FSX 2011-04-23 10:44:35

I already got that done. haven't tested this extensively, but it works in my small test text.

%\[/?(?!quote)[a-z]+(?:=[^\]]+)?\]%i

Now I'll have to do the quote converting. I'll send a pull request once it's done.

FSX 2011-04-23 12:22:01

  • Uploaded patch strip_bbcode.txt. (view)

I've got the BBcode quote converting working. The only two things I haven't done is how URL and IMG tags are handled. Suggestions?

I'll merge the attached code and commit it after the two remaining points are done.

FSX 2011-04-23 13:28:14

Oh, wordwrapping doesn't work as expected. I'll fix that.

FSX 2011-04-23 14:54:42

  • Uploaded patch strip_bbcode.txt. (view)

Everything should work fine now. I've attached the script. The only two things I haven't done is how URL and IMG tags are handled. Suggestions?

Franz 2011-04-23 16:26:08

Hmm, maybe convert links to something like this:

linktext (URL)

Or is that too far-fetched?

FSX 2011-04-23 16:45:10

Hmm, what about:

Some text [an url][1] and [an image][2].

[1]: http://urltowebsite.net
[2]: http://urltowebsite.net/image.png

To keep the text nice and clean. Doesn't take a lot of code to do that.

Franz 2011-04-23 16:46:19

Good idea. I was gonna say that would confuse people, but it's actually quite logical markup.

FSX 2011-04-23 16:55:19

Alright. I'll commit this after merging and testing.

quy 2011-04-23 17:01:32

The LIST tag should also be addressed.

FSX 2011-04-23 18:08:46

Thanks for mentioning that quy! I forgot that one. smile

FSX 2011-04-25 09:36:33

I'm home again and work is done.

Nested lists won't be as clear in a plain text email, because email clients don't use a monospace font so the indention will be lost.

FSX 2011-07-08 10:30:01

I have committed the code to my own fork. It's not finished yet, but I don't have much time before I leave for vacation.

Here's the commit: http://bit.ly/q5q21p

FSX 2011-08-06 11:23:02

  • Status changed from open to fixed.