在线文本对比
浏览器并排文本与代码 Diff 对比台
左侧粘贴原文,右侧粘贴修改稿。对比结果、行内高亮和统一补丁都留在本设备上。
工作台需要本浏览器启用 JavaScript。没有脚本时,你仍可阅读补丁指南和示例,但无法进行实时对比、复制或下载。
{
"service": "checkout-api",
"version": "1.4.0",
"rateLimit": {
"windowSeconds": 60,
"maxRequests": 120
},
"featureFlags": {
"newCheckout": false,
"legacyCart": true,
"auditLog": true
},
"cors": {
"origins": [
"shop.example.com",
"admin.example.com"
],
"allowCredentials": true
}
}
{
"service": "checkout-api",
"version": "1.5.0",
"rateLimit": {
"windowSeconds": 60,
"maxRequests": 200
},
"featureFlags": {
"newCheckout": true,
"legacyCart": false,
"auditLog": true,
"expressPay": true
},
"cors": {
"origins": [
"shop.example.com",
"admin.example.com",
"preview.example.com"
],
"allowCredentials": true
}
}
upstream shop_app {
server 127.0.0.1:8080;
}
server {
listen 80;
server_name shop.example.com;
root /var/www/shop;
index index.html;
location / {
proxy_pass shop_app;
proxy_set_header Host $host;
proxy_read_timeout 30s;
}
location /assets/ {
expires 1h;
add_header Cache-Control "public";
}
}
upstream shop_app {
server 127.0.0.1:8080;
}
server {
listen 443 ssl http2;
server_name shop.example.com;
root /var/www/shop;
index index.html;
gzip on;
gzip_types text/css application/javascript application/json;
location / {
proxy_pass shop_app;
proxy_set_header Host $host;
proxy_read_timeout 90s;
proxy_http_version 1.1;
}
location /assets/ {
expires 30d;
add_header Cache-Control "public, immutable";
add_header X-Content-Type-Options nosniff;
}
}
SELECT o.id, o.created_at, c.email, SUM(i.qty * i.unit_price) AS total FROM orders o INNER JOIN customers c ON c.id = o.customer_id INNER JOIN order_items i ON i.order_id = o.id WHERE o.created_at >= '2024-01-01' AND o.status <> 'cancelled' GROUP BY o.id, o.created_at, c.email ORDER BY o.created_at DESC;
CREATE INDEX idx_orders_created_status
ON orders (created_at, status);
SELECT
o.id,
o.created_at,
c.email,
SUM(i.qty * i.unit_price) AS total
FROM orders o
LEFT JOIN customers c ON c.id = o.customer_id
INNER JOIN order_items i ON i.order_id = o.id
WHERE o.created_at >= '2025-01-01'
AND o.status IN ('paid', 'shipped')
GROUP BY o.id, o.created_at, c.email
ORDER BY o.created_at DESC;
# Release notes
## 1.2.0
- Format and minify a query in the browser.
- Add a --watch flag for local previews.
- Document the default port in the README.
Usage:
desk format --file query.sql
# Release notes
## 1.3.0
- Format and minify a query in the browser.
- Add a --dry-run flag before writing a file.
- Add a --watch flag for local previews.
- Document the default port and locale prefix in the README.
Usage:
desk format --file query.sql --dry-run
常见问题
需要注册账号吗?
不需要。对比在本浏览器中完成。没有文件可上传,也没有登录。
对比过程会离开这台设备吗?
不会。行级对比、行内高亮、复制以及 .patch / .diff 下载都留在本页,不会发送到服务器。
“忽略空白”和“忽略大小写”做什么?
忽略空白时,比较行会把首尾空白和连续空格视为相同。忽略大小写时,比较字母时不区分大小写。屏幕上仍显示你输入的原文。
下载的补丁里有什么?
一份 GNU 统一 diff,包含 --- / +++ 文件头、@@ 块范围、3 行上下文,以及 + / - / 空格标记。.patch 与 .diff 内容相同,只是文件名不同。
相关工具与参考
这里列出同属 jmforu.com 的工具台,以及本页所写统一格式的官方说明。出现链接并不表示本次构建探测过该地址。
- JM Hub — jmforu.com 工具集的目录。
- JM SQL Format — 同系列的浏览器 SQL 格式化与检查台,无需上传。
- JM Cron Helper — 同系列的浏览器 Cron 表达式生成与解释台。
- JM Timezone Meet — 同系列的跨时区会议重叠时段计算台。
- JM JWT Decode — 同系列的浏览器 JWT 本地解析台,不会把令牌发到服务器。
- GNU 统一 diff 格式 — Diffutils 官方说明,介绍本工具写出的统一格式(`---`、`+++` 与 `@@` 块头)。