pinboard-elinks

Check-in [a2d3a5dc83]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Revert commits 7036095 and 4fd8445

Figured out you can append to Lua functions so I'll leave this for
Pinboard only and append to it in my hooks.lua file.

Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | master | trunk
Files: files | file ages | folders
SHA3-256: a2d3a5dc830572a7ed756074cbab6da9eb4a92cebaddbe23d4dc07c699ae55cf
User & Date: base@atomicules.co.uk 2015-08-07 22:08:22
Context
2015-08-07
22:08
Revert commits 7036095 and 4fd8445

Figured out you can append to Lua functions so I'll leave this for
Pinboard only and append to it in my hooks.lua file. Leaf check-in: a2d3a5dc83 user: base@atomicules.co.uk tags: master, trunk

20:32
Add comment about how last commit not related to Pinboard check-in: b8e00b07b3 user: base@atomicules.co.uk tags: master, trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to pinboard.lua.

50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
		html = string.gsub (html, '(<div id="top_menu">\n<a href="/u:)(%w-)(/".-</a> ‧ )', '%1%2%3<a href="/u:%2/starred/" >starred</a>  ‧ <a href="/u:%2/tweets/" >tweets</a> ‧')
		return html
	elseif string.find(url, "://pinboard.in/add%?url=") then --need to escape the ? here
		--Remove delete and destroy from the add page.
		html = string.gsub (html, '<div style="display:inline" id="delete_.-</div>', '')
		html = string.gsub (html, '<div style="visibility:hidden;display:none" class="delete_div" id="destroy_.-</div>', '')
		return html
	--Fix none, wrapping pages. For now, just this one
	--This is nothing to do with Pinboard, but I can only have one pre_format_html_hook
	elseif string.find(url, "antirez") then
		--Change <pre> to <div> this is very hacky and prone to failure
		html = string.gsub (html, '<pre(.-)</pre>', '<div%1</div>')
		--html = string.gsub (html, '<pre(.-)</pre>.-</div><div.->', '<div%1</div>')
		--But since we only want to do this for pre not followed by code, change any divs followed by code back to pre
		html = string.gsub (html, '<div(.-<code.-</code>.-)</div>', '<pre%1</pre>')
		return html
	end
end


function new_edit_link (s)
	local _,_,link = string.find (s, '<a class="bookmark_title.-href="(.-)"')
	local login,token = readnetrc()







<
<
<
<
<
<
<
<
<







50
51
52
53
54
55
56









57
58
59
60
61
62
63
		html = string.gsub (html, '(<div id="top_menu">\n<a href="/u:)(%w-)(/".-</a> ‧ )', '%1%2%3<a href="/u:%2/starred/" >starred</a>  ‧ <a href="/u:%2/tweets/" >tweets</a> ‧')
		return html
	elseif string.find(url, "://pinboard.in/add%?url=") then --need to escape the ? here
		--Remove delete and destroy from the add page.
		html = string.gsub (html, '<div style="display:inline" id="delete_.-</div>', '')
		html = string.gsub (html, '<div style="visibility:hidden;display:none" class="delete_div" id="destroy_.-</div>', '')
		return html









	end
end


function new_edit_link (s)
	local _,_,link = string.find (s, '<a class="bookmark_title.-href="(.-)"')
	local login,token = readnetrc()