Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: af6dc5314d
Fetching contributors…

Cannot retrieve contributors at this time

42 lines (38 sloc) 1.076 kb
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>beforeRunningCommand</key>
<string>nop</string>
<key>command</key>
<string>#!/usr/bin/env ruby
$KCODE = 'U'
$entity_to_char = { }
File.open("#{ENV['TM_BUNDLE_SUPPORT']}/entities.txt").read.scan(/^(\d+)\t(.+)$/) do |key, value|
$entity_to_char[value] = [key.to_i].pack('U')
end
res = STDIN.read.gsub(/&amp;(?:([a-z0-9]+)|#([0-9]+)|#x([0-9A-F]+));/i) do |m|
if $1 then
$entity_to_char[$1] || m
else
[$2 ? $2.to_i : $3.hex].pack("U")
end
end
print res
</string>
<key>fallbackInput</key>
<string>line</string>
<key>input</key>
<string>selection</string>
<key>keyEquivalent</key>
<string>@&amp;</string>
<key>name</key>
<string>Decode Entities in Line / Selection</string>
<key>output</key>
<string>replaceSelectedText</string>
<key>scope</key>
<string>text.html</string>
<key>uuid</key>
<string>C183920D-A126-11D9-A5A2-000D93C8BE28</string>
</dict>
</plist>
Jump to Line
Something went wrong with that request. Please try again.