Skip to content

Commit

Permalink
Merge branch 'release/v1.5.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
freder committed Apr 29, 2023
2 parents a5b9bb3 + 7754f70 commit 9919aa9
Show file tree
Hide file tree
Showing 8 changed files with 5,477 additions and 1,744 deletions.
6 changes: 3 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module.exports = {
env: {
browser: true,
es2021: true,
// 'jest/globals': true,
'jest/globals': true,
},
globals: {
// React: true,
Expand All @@ -25,7 +25,7 @@ module.exports = {
'react-hooks',
// 'jsx-a11y',
'@typescript-eslint',
// 'jest',
'jest',
'functional',
// 'fp',
// 'better-mutation',
Expand All @@ -37,7 +37,7 @@ module.exports = {
'plugin:react/recommended',
// 'plugin:jsx-a11y/recommended',
// 'plugin:import/recommended',
// 'plugin:jest/recommended',
'plugin:jest/recommended',
// 'plugin:functional/external-recommended',
// 'plugin:functional/recommended',
// 'plugin:functional/stylistic',
Expand Down
24 changes: 24 additions & 0 deletions __tests__/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { cleanLabel } from '../src/utils/index';


describe('cleanLabel', () => {
it('should remove properties', () => {
const content = `## asdf
id:: 643135d6-33b2-4aea-a78c-e6b3e0ce0f80
test-asdf:: 12 12`;
const result = cleanLabel(content);
expect(result).toEqual('## asdf');
});

it('should remove todo items', () => {
const content = 'TODO buy milk';
const result = cleanLabel(content);
expect(result).toEqual('buy milk');
});

it('should image dimensions', () => {
const content = '![](./asdf.png) {:width 400}';
const result = cleanLabel(content);
expect(result).toEqual('![](./asdf.png)');
});
});
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 1.5.3
### Fixed
- Improved regular expressions for label rendering (to filter out keywords, properties, etc.)

## 1.5.2
### Fixed
- Fixed bug where expanding collapsed blocks wasn't working properly
Expand Down
5 changes: 5 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
};
Loading

0 comments on commit 9919aa9

Please sign in to comment.