Skip to content

Commit

Permalink
chore: add a comment on a potential issue in the future
Browse files Browse the repository at this point in the history
  • Loading branch information
nvh95 committed Jun 4, 2022
1 parent f30b441 commit 88c61df
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ postcss(
const stringHash = require('string-hash');
const i = css.indexOf('.' + name);
const line = css.substr(0, i).split(/[\\r\\n|\\n|\\r]/).length;
// This is not how the real app work, might be an issue if we try to make the snapshot interactive
// https://github.com/nvh95/jest-preview/issues/84#issuecomment-1146578932
const removedNewLineCharactersCss = css.replace(/(\\r\\n|\\n|\\r)/g, '');
const hash = stringHash(removedNewLineCharactersCss).toString(36).substr(0, 5);
return '_' + name + '_' + hash + '_' + line;
Expand Down

0 comments on commit 88c61df

Please sign in to comment.