mirror of
https://github.com/alam00000/bentopdf.git
synced 2026-11-05 11:52:48 +01:00
Compare commits
7
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f638f8e4db | ||
|
|
24b060a134 | ||
|
|
6dca41aeb4 | ||
|
|
2a8ce12b6e | ||
|
|
d03594a09d | ||
|
|
a25c6511ce | ||
|
|
6d8ef7d694 |
+2
-2
@@ -7,10 +7,10 @@ type: application
|
||||
# This is the chart version. This version number should be incremented each time you make changes
|
||||
# to the chart and its templates, including the app version.
|
||||
# Versions are expected to follow Semantic Versioning (https://semver.org/)
|
||||
version: 1.0.9
|
||||
version: 1.0.10
|
||||
|
||||
# This is the version number of the application being deployed. This version number should be
|
||||
# incremented each time you make changes to the application. Versions are not expected to
|
||||
# follow Semantic Versioning. They should reflect the version the application is using.
|
||||
# It is recommended to use it with quotes.
|
||||
appVersion: '2.8.10'
|
||||
appVersion: '2.8.11'
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "bento-pdf",
|
||||
"private": true,
|
||||
"version": "2.8.10",
|
||||
"version": "2.8.11",
|
||||
"license": "AGPL-3.0-only",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
|
||||
@@ -424,7 +424,7 @@ async function performFlatteningCrop(
|
||||
return newPdfDoc.save();
|
||||
}
|
||||
|
||||
function resetState() {
|
||||
export function resetState() {
|
||||
if (cropperState.cropper) {
|
||||
cropperState.cropper.destroy();
|
||||
cropperState.cropper = null;
|
||||
@@ -447,4 +447,6 @@ function resetState() {
|
||||
|
||||
const cropBtn = document.getElementById('crop-button') as HTMLButtonElement;
|
||||
if (cropBtn) cropBtn.disabled = true;
|
||||
|
||||
window.scrollTo({ top: 0, behavior: 'smooth' });
|
||||
}
|
||||
|
||||
@@ -84,6 +84,7 @@ const ESCAPED_MATH: ReadonlyArray<[string, string, boolean]> = [
|
||||
['\\\\[', '\\\\]', true],
|
||||
['\\\\(', '\\\\)', false],
|
||||
['\\[', '\\]', true],
|
||||
['$`', '`$', false],
|
||||
];
|
||||
|
||||
function escapedMath(state: StateInline, silent: boolean): boolean {
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
import { describe, it, expect, vi, beforeEach } from 'vitest';
|
||||
import { resetState } from '../js/logic/crop-pdf-page.ts';
|
||||
|
||||
// Test resetState function for cropping
|
||||
describe('resetState', () => {
|
||||
beforeEach(() => {
|
||||
vi.spyOn(window, 'scrollTo').mockImplementation(() => {});
|
||||
});
|
||||
|
||||
it('scrolls the page to the top after resetting', () => {
|
||||
resetState();
|
||||
|
||||
expect(window.scrollTo).toHaveBeenCalledWith({
|
||||
top: 0,
|
||||
behavior: 'smooth',
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -58,10 +58,17 @@ describe('Markdown to PDF rendering', () => {
|
||||
'',
|
||||
'```math\n\\int x\n```',
|
||||
'',
|
||||
'GitHub $`\\sqrt{3}`$ inline.',
|
||||
'',
|
||||
'Price $5 and $10, escaped \\$3, code `$q$`.',
|
||||
].join('\n')
|
||||
);
|
||||
expect(root.querySelectorAll('.katex').length).toBe(8);
|
||||
expect(root.querySelectorAll('.katex').length).toBe(9);
|
||||
const github = [...root.querySelectorAll('p')].find((p) =>
|
||||
p.textContent?.startsWith('GitHub')
|
||||
);
|
||||
expect(github?.querySelector('.katex')).not.toBeNull();
|
||||
expect(github?.textContent).not.toMatch(/[$`‘’]/);
|
||||
expect(root.querySelectorAll('.katex-display').length).toBe(5);
|
||||
expect(root.querySelector('em')).toBeNull();
|
||||
expect(root.textContent).toContain('Price $5 and $10, escaped $3');
|
||||
|
||||
Reference in New Issue
Block a user