1
Livid MOD |
4
sopp 2011-05-31 10:23:16 +08:00
|
5
cmonday 2011-05-31 10:38:35 +08:00
跑个题,照片是LZ本人么……
|
7
chone 2011-05-31 11:03:08 +08:00
|
12
manhere 2011-05-31 12:55:54 +08:00
对@的判断确实有点小问题啊
|
13
uper OP 其实 我是个man,各位不要胡思乱想
|
14
chouj 2011-05-31 14:55:53 +08:00
噶嘣。。
|
16
life 2011-06-30 11:44:15 +08:00
期待绑上gs
|
19
muxi 2011-06-30 13:13:15 +08:00
|
20
zern 2011-07-04 01:10:59 +08:00
我加了BBCODE支持[IMG],还好。。图床很多
|
22
zern 2011-07-08 22:56:44 +08:00
@life 在v2ex\templatetags\filters.py
加入: def bbcode_content(value): pat = re.compile(r'<([^>]*?)>', re.DOTALL | re.M) value = re.sub(pat, '<\\1>', value) bbdata = [ (r'\[url\](.+?)\[/url\]', r'<a href="\1">\1</a>'), (r'\[url=(.+?)\](.+?)\[/url\]', r'<a class="link-segment" href="\1">\2</a>'), (r'\[email\](.+?)\[/email\]', r'<a href="mailto:\1">\1</a>'), (r'\[email=(.+?)\](.+?)\[/email\]', r'<a href="mailto:\1">\2</a>'), (r'\[img\](.+?)\[/img\]', r'<img src="\1">'), (r'\[img=(.+?)\](.+?)\[/img\]', r'<img src="\1" alt="\2">'), (r'\[b\](.+?)\[/b\]', r'<b>\1</b>'), (r'\[i\](.+?)\[/i\]', r'<i>\1</i>'), (r'\[u\](.+?)\[/u\]', r'<u>\1</u>'), (r'\[quote\](.+?)\[/quote\]', r'<blockquote class="content-quote">\1</blockquote>'), (r'\[center\](.+?)\[/center\]', r'<div align="center">\1</div>'), (r'\[code\]\s?(.+?)\[/code\]', r'<blockquote class="code-segment"><code><pre>\1</pre></code></blockquote>'), (r'\[big\](.+?)\[/big\]', r'<big>\1</big>'), (r'\[small\](.+?)\[/small\]', r'<small>\1</small>'), ] for bbset in bbdata: p = re.compile(bbset[0], re.DOTALL) value = p.sub(bbset[1], value) return value register.filter(bbcode_content) ---- 然后在调用就好了 "tpl\portion\topic_content.html"(1,25):{{ topic.content|escape|bbcode_content|youtube|youku|imgly|clly|mentions|gist|urlize|linebreaksbr }} "tpl\portion\topic_replies.html"(14,76): <div class="content reply_content">{{ reply.content|escape|bbcode_content|youku|imgly|clly|mentions|gist|urlize|linebreaksbr }}</div> |
23
zern 2011-07-08 23:03:18 +08:00
|
26
bcxx 2011-07-10 15:20:41 +08:00
|
27
Rice 2011-07-10 16:12:30 +08:00
贴图好麻烦啊,右边那两个图床要翻墙才能用……
|
29
hzlzh 2012-02-16 18:33:40 +08:00
测试贴图:
http://img.ly/e0xF |
30
sniper114713 2012-04-02 21:54:00 +08:00
|
31
vibbow 2012-04-03 03:22:22 +08:00
要是能直接把后缀是.jpg, .gif, .png的连接自动转换成图片就好了。
|
32
Narcissu5 2015-02-13 11:52:53 +08:00
|
33
Marlon 2015-11-20 18:18:54 +08:00
test
|
34
Marlon 2015-11-20 18:22:44 +08:00
|
35
dasangshu 2015-12-01 19:19:02 +08:00
|
36
dasangshu 2015-12-01 19:19:37 +08:00
|
37
965380535 2016-01-08 11:26:15 +08:00
|
38
iniwap 2016-03-01 13:27:35 +08:00
![ ]
|
39
iniwap 2016-03-01 13:27:59 +08:00
|
40
purensong 2016-05-11 18:23:22 +08:00
sina 这个图片怎么上传没看到有 v 友说啊
|
41
Whitehead 2016-07-20 10:43:30 +08:00
|
42
Whitehead 2016-07-20 10:43:54 +08:00
|
43
Whitehead 2016-07-20 10:45:28 +08:00
|
44
gewai 2016-07-26 15:11:18 +08:00
|
45
gewai 2016-07-26 15:12:06 +08:00
|
46
chemzqm 2016-09-13 14:14:22 +08:00
|
47
scarecrow 2016-09-20 09:47:17 +08:00
|
48
scarecrow 2016-09-20 09:47:53 +08:00
|
49
skyxin888 2016-09-20 14:53:32 +08:00
|
50
skyxin888 2016-09-20 14:53:51 +08:00
|
51
skyxin888 2016-09-20 14:56:55 +08:00
|
52
skyxin888 2016-09-20 14:58:17 +08:00
|
53
easing 2016-10-07 21:23:16 +08:00
|
54
acumen 2016-10-20 21:53:12 +08:00
|
55
sisteryu100 2016-10-29 15:14:46 +08:00
<img src=" " alt=" bg2.jpg"/>
|
56
pancnlz 2016-11-02 14:04:12 +08:00
|
57
pancnlz 2016-11-02 14:04:25 +08:00
|
58
pancnlz 2016-11-02 14:05:00 +08:00
![img]( https://moepic.org/image/LhfRh)
|
59
pancnlz 2016-11-02 14:07:18 +08:00
[![8e8c4ad67e48509b16dd468c998a524b.png]( https://moepic.org/images/2016/11/02/8e8c4ad67e48509b16dd468c998a524b.png)]( https://moepic.org/image/LhfRh)
|
60
pancnlz 2016-11-02 14:08:20 +08:00
|
61
pancnlz 2016-11-02 14:08:41 +08:00
|
62
pancnlz 2016-11-02 14:09:50 +08:00
|
63
815lbh 2016-11-28 11:55:49 +08:00
|
65
Martox 2017-03-12 13:20:18 +08:00
|
66
Martox 2017-03-12 13:20:45 +08:00
|
67
kolor 2017-06-02 16:33:38 +08:00
|
68
kolor 2017-06-02 16:34:29 +08:00
|
69
fhy1994 2019-05-14 15:19:05 +08:00
|