mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
42 lines
1.1 KiB
Plaintext
42 lines
1.1 KiB
Plaintext
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE plist PUBLIC "-//Apple//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 -wKU
|
|
STDOUT.sync = true
|
|
|
|
page = STDIN.read
|
|
page.gsub!(/<\?(php|=).*?\?>|<%.*?%>/m, '')
|
|
|
|
open('|curl -sF uploaded_file=@-\;type=text/html http://validator.w3.org/check', 'r+') do |io|
|
|
io << page; io.close_write
|
|
|
|
result = io.read
|
|
|
|
result.gsub!(/<\/title>/, '\&<base href="http://validator.w3.org/">')
|
|
result.gsub!(/Line (\d+),?\s*Column (\d+)/mi) do
|
|
"<a href=\"txmt://open?line=#$1&amp;column=#{$2.to_i + 1}\">#$&</a>"
|
|
end
|
|
puts result
|
|
end
|
|
</string>
|
|
<key>dontFollowNewOutput</key>
|
|
<true/>
|
|
<key>input</key>
|
|
<string>document</string>
|
|
<key>keyEquivalent</key>
|
|
<string>^V</string>
|
|
<key>name</key>
|
|
<string>Validate Syntax (W3C)</string>
|
|
<key>output</key>
|
|
<string>showAsHTML</string>
|
|
<key>scope</key>
|
|
<string>text.html</string>
|
|
<key>uuid</key>
|
|
<string>3F26240E-6E4A-11D9-B411-000D93589AF6</string>
|
|
</dict>
|
|
</plist>
|