Hi.
I noticed that on my forum a user with user.has_trust_level?(TrustLevel[3]) == true
has rel=nofollow on their links. For example:
https://forum.pololu.com/badges/3/leader
For the forum settings, I have “tl3 links no follow” unchecked, and “add rel nofollow to user content” checked, and “exclude rel nofollow domains” set to “pololu.com”.
The relevant code seems to be at https://github.com/discourse/discourse/blob/e55e2aff94959aecc28095875f5de351de26162f/app/models/post.rb#L206
Currently our forum is on version Version v1.6.0.beta12 +7
and here is the current plugins we are using:
Here is my Pry session trying to figure out what is going on:
[18] pry(main)> p = Post.where(id: 49157).first
=> #<Post:0x005580ef1f08b8
id: 49157,
user_id: 436,
topic_id: 10535,
post_number: 6,
raw:
"Based on the part that says `console=ttyS0,115200`, it looks like your Raspberry Pi is configured to use the UART as a console, which will interfere with using it to control the Qik. I recommend following the instructions from this blog post to get the UART working on your Raspberry Pi 3:\n\nhttp://www.briandorey.com/post/Raspberry-Pi-3-UART-Boot-Overlay-Part-Two\n\nPlease note that these instructions also involve disabling and Bluetooth and WiFi.\n\n--David",
cooked:
"<p>Based on the part that says <code>console=ttyS0,115200</code>, it looks like your Raspberry Pi is configured to use the UART as a console, which will interfere with using it to control the Qik. I recommend following the instructions from this blog post to get the UART working on your Raspberry Pi 3:</p>\n\n<p><a href=\"http://www.briandorey.com/post/Raspberry-Pi-3-UART-Boot-Overlay-Part-Two\" class=\"onebox\" target=\"_blank\" rel=\"nofollow\">http://www.briandorey.com/post/Raspberry-Pi-3-UART-Boot-Overlay-Part-Two</a></p>\n\n<p>Please note that these instructions also involve disabling and Bluetooth and WiFi.</p>\n\n<p>--David</p>",
created_at: Wed, 03 Aug 2016 16:33:48 UTC +00:00,
updated_at: Thu, 11 Aug 2016 20:21:40 UTC +00:00,
reply_to_post_number: 5,
reply_count: 0,
quote_count: 0,
deleted_at: nil,
off_topic_count: 0,
like_count: 0,
incoming_link_count: 8,
bookmark_count: 0,
avg_time: 43,
score: 33.75,
reads: 8,
post_type: 1,
vote_count: 0,
sort_order: 6,
last_editor_id: 436,
hidden: false,
hidden_reason_id: nil,
notify_moderators_count: 0,
spam_count: 0,
illegal_count: 0,
inappropriate_count: 0,
last_version_at: Wed, 03 Aug 2016 18:58:29 UTC +00:00,
user_deleted: false,
reply_to_user_id: 12636,
percent_rank: 0.0,
notify_user_count: 0,
like_score: 0,
deleted_by_id: nil,
edit_reason: nil,
word_count: 79,
version: 2,
cook_method: 1,
wiki: false,
baked_at: Thu, 11 Aug 2016 20:21:40 UTC +00:00,
baked_version: 1,
hidden_at: nil,
self_edits: 3,
reply_quoted: false,
via_email: false,
raw_email: nil,
public_version: 2,
action_code: nil>
[19] pry(main)> p.user.has_trust_level?(TrustLevel[3])
=> true
[20] pry(main)> SiteSetting.tl3_links_no_follow
=> false
[21] pry(main)> p.cooked.grep "nofollow"
NoMethodError: undefined method `grep' for #<String:0x005580ef22b850>
from (pry):21:in `__pry__'
[22] pry(main)> p.cooked.include? "nofollow"
=> true
[23] pry(main)> p.rebake!
=> true
[24] pry(main)> p.cooked.include? "nofollow"
=> false
[25] pry(main)> p.save!
=> true
[26] pry(main)> p = Post.where(id: 49157).first
=> #<Post:0x005580ef89dcb0
id: 49157,
user_id: 436,
topic_id: 10535,
post_number: 6,
raw:
"Based on the part that says `console=ttyS0,115200`, it looks like your Raspberry Pi is configured to use the UART as a console, which will interfere with using it to control the Qik. I recommend following the instructions from this blog post to get the UART working on your Raspberry Pi 3:\n\nhttp://www.briandorey.com/post/Raspberry-Pi-3-UART-Boot-Overlay-Part-Two\n\nPlease note that these instructions also involve disabling and Bluetooth and WiFi.\n\n--David",
cooked:
"<p>Based on the part that says <code>console=ttyS0,115200</code>, it looks like your Raspberry Pi is configured to use the UART as a console, which will interfere with using it to control the Qik. I recommend following the instructions from this blog post to get the UART working on your Raspberry Pi 3:</p>\n\n<p><a href=\"http://www.briandorey.com/post/Raspberry-Pi-3-UART-Boot-Overlay-Part-Two\" class=\"onebox\" target=\"_blank\" rel=\"nofollow\">http://www.briandorey.com/post/Raspberry-Pi-3-UART-Boot-Overlay-Part-Two</a></p>\n\n<p>Please note that these instructions also involve disabling and Bluetooth and WiFi.</p>\n\n<p>--David</p>",
created_at: Wed, 03 Aug 2016 16:33:48 UTC +00:00,
updated_at: Thu, 11 Aug 2016 20:24:29 UTC +00:00,
reply_to_post_number: 5,
reply_count: 0,
quote_count: 0,
deleted_at: nil,
off_topic_count: 0,
like_count: 0,
incoming_link_count: 8,
bookmark_count: 0,
avg_time: 43,
score: 33.75,
reads: 8,
post_type: 1,
vote_count: 0,
sort_order: 6,
last_editor_id: 436,
hidden: false,
hidden_reason_id: nil,
notify_moderators_count: 0,
spam_count: 0,
illegal_count: 0,
inappropriate_count: 0,
last_version_at: Wed, 03 Aug 2016 18:58:29 UTC +00:00,
user_deleted: false,
reply_to_user_id: 12636,
percent_rank: 0.0,
notify_user_count: 0,
like_score: 0,
deleted_by_id: nil,
edit_reason: nil,
word_count: 79,
version: 2,
cook_method: 1,
wiki: false,
baked_at: Thu, 11 Aug 2016 20:24:29 UTC +00:00,
baked_version: 1,
hidden_at: nil,
self_edits: 3,
reply_quoted: false,
via_email: false,
raw_email: nil,
public_version: 2,
action_code: nil>
[27] pry(main)> p.cooked.include? "nofollow"
=> true
When I call rebake!
on the post, it does not have the “nofollow” but when I save it and reload it from the database, it does.
Ryan