feat: Initial clean release of CHM
一些检查失败了
automerge / automerge (push) Has been cancelled
react-native-android-build-apk / AssembleRelease (push) Has been cancelled
Build macOS M1 / Main (push) Has been cancelled
Joplin Continuous Integration / Main (macos-15-intel) (push) Has been cancelled
Joplin Continuous Integration / Main (ubuntu-22.04) (push) Has been cancelled
Joplin Continuous Integration / Main (ubuntu-22.04-arm) (push) Has been cancelled
Joplin Continuous Integration / Main (windows-11-vs2026-arm) (push) Has been cancelled
Joplin Continuous Integration / Main (windows-2025) (push) Has been cancelled
Joplin Continuous Integration / ServerDockerImage (ubuntu-22.04) (push) Has been cancelled
Joplin Continuous Integration / ServerDockerImage (ubuntu-22.04-arm) (push) Has been cancelled
Joplin UI tests / Main (ubuntu-22.04) (push) Has been cancelled
Joplin UI tests / Main (windows-2025) (push) Has been cancelled
Joplin UI tests / Mobile (push) Has been cancelled
Close stale issues / ProcessStaleIssues (push) Has been cancelled
一些检查失败了
automerge / automerge (push) Has been cancelled
react-native-android-build-apk / AssembleRelease (push) Has been cancelled
Build macOS M1 / Main (push) Has been cancelled
Joplin Continuous Integration / Main (macos-15-intel) (push) Has been cancelled
Joplin Continuous Integration / Main (ubuntu-22.04) (push) Has been cancelled
Joplin Continuous Integration / Main (ubuntu-22.04-arm) (push) Has been cancelled
Joplin Continuous Integration / Main (windows-11-vs2026-arm) (push) Has been cancelled
Joplin Continuous Integration / Main (windows-2025) (push) Has been cancelled
Joplin Continuous Integration / ServerDockerImage (ubuntu-22.04) (push) Has been cancelled
Joplin Continuous Integration / ServerDockerImage (ubuntu-22.04-arm) (push) Has been cancelled
Joplin UI tests / Main (ubuntu-22.04) (push) Has been cancelled
Joplin UI tests / Main (windows-2025) (push) Has been cancelled
Joplin UI tests / Mobile (push) Has been cancelled
Close stale issues / ProcessStaleIssues (push) Has been cancelled
这个提交包含在:
@@ -0,0 +1,57 @@
|
||||
import { splitHtml, SplittedHtml } from './HtmlToHtml';
|
||||
|
||||
describe('HtmlToHtml', () => {
|
||||
|
||||
test('should split an HTML string into HTML and CSS', () => {
|
||||
const testCases: [string, SplittedHtml][] = [
|
||||
[
|
||||
'',
|
||||
{
|
||||
html: '',
|
||||
css: '',
|
||||
},
|
||||
],
|
||||
[
|
||||
'<style>b { font-weight: bold; }</style>\n<div>hello</div>\n<p>another line</p>',
|
||||
{
|
||||
html: '\n<div>hello</div>\n<p>another line</p>',
|
||||
css: 'b { font-weight: bold; }',
|
||||
},
|
||||
],
|
||||
[
|
||||
'<STYLE>b { font-weight: bold; }</STYLE>\n<div>hello</div>',
|
||||
{
|
||||
html: '\n<div>hello</div>',
|
||||
css: 'b { font-weight: bold; }',
|
||||
},
|
||||
],
|
||||
[
|
||||
'<html><head><STYLE>b { font-weight: bold; }</STYLE></head>\n<div>hello</div>',
|
||||
{
|
||||
html: '<html><head><STYLE>b { font-weight: bold; }</STYLE></head>\n<div>hello</div>',
|
||||
css: '',
|
||||
},
|
||||
],
|
||||
// cSpell:disable
|
||||
[
|
||||
`<style></style>
|
||||
<p><br></p><div class="moz-forward-container"><br><br>-------- Message transféré --------<table class="moz-email-headers-table" cellspacing="0" cellpadding="0" border="0"><tbody><tr><th valign="BASELINE" nowrap="nowrap" align="RIGHT">Sujet :</th><td>
|
||||
Your car rental booking DC-7706328 is confirmed (pick-up on 1 October 2024)</td></tr></tbody></table><style type="text/css"></style>`,
|
||||
{
|
||||
html: `
|
||||
<p><br></p><div class="moz-forward-container"><br><br>-------- Message transféré --------<table class="moz-email-headers-table" cellspacing="0" cellpadding="0" border="0"><tbody><tr><th valign="BASELINE" nowrap="nowrap" align="RIGHT">Sujet :</th><td>
|
||||
Your car rental booking DC-7706328 is confirmed (pick-up on 1 October 2024)</td></tr></tbody></table><style type="text/css"></style>`,
|
||||
css: '',
|
||||
},
|
||||
],
|
||||
// cSpell:enable
|
||||
];
|
||||
|
||||
for (const t of testCases) {
|
||||
const [input, expected] = t;
|
||||
const actual = splitHtml(input);
|
||||
expect(actual).toEqual(expected);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
在新工单中引用
屏蔽一个用户