Skip to content

Commit

Permalink
fix: .* could not match multi lines, use [\s\S]* instead, close #4
Browse files Browse the repository at this point in the history
  • Loading branch information
JounQin committed Jul 30, 2019
1 parent de73bf3 commit f7e7efe
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rxts/eslint-plugin-mdx",
"version": "0.3.0",
"version": "0.3.1",
"description": "ESLint Parser/Plugin for MDX",
"repository": "git@github.com:rx-ts/eslint-plugin-mdx.git",
"author": "JounQin <admin@1stg.me>",
Expand Down
1 change: 0 additions & 1 deletion src/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"extends": "../tsconfig.json",
"compilerOptions": {
"declaration": true,
"module": "commonjs",
"outDir": "../dist"
}
}
2 changes: 1 addition & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const comment = '<!---->|<!--(?:-?[^>-])(?:-?[^-])*-->'
export const OPEN_TAG_REGEX = new RegExp(`^(?:${openTag})$`)
export const CLOSE_TAG_REGEX = new RegExp(`^(?:${closeTag})$`)
export const OPEN_CLOSE_TAG_REGEX = new RegExp(
`^(?:${openTag + '.*' + closeTag})$`,
`^(?:${openTag + '[\\s\\S]*' + closeTag})$`,
)
export const VOID_TAG_REGEX = new RegExp(`^(?:${voidTag})$`)
export const COMMENT_REGEX = new RegExp(`^(?:${comment})$`)
Expand Down
65 changes: 65 additions & 0 deletions test/fixture4.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---
name: FollowReveal
route: /follow-reveal
---

# FollowReveal

A `<FollowReveal>` is a like a `<TurnReveal>` that follows the mouse's movements in and out of the component.
Just like the `<TurnReveal>`, place it in an element that has `position: relative` and make sure it is a direct child of the element on which you define the `perspective` property.

import { Props, Playground } from 'docz'
import FollowReveal from './FollowReveal'
import { Front, PlaceHolderImage, Grid } from 'docs/PlayGroundUtils'

<Props of={FollowReveal} />

## Basic Usage

<Playground style={{ display: 'flex', justifyContent: 'center' }}>
{() => {
const perspective = 400
return (
<div style={{ position: 'relative', perspective: perspective + 'px' }}>
<FollowReveal perspective={perspective}>
<Front>More info</Front>
</FollowReveal>
<PlaceHolderImage />
</div>
)
}}
</Playground>

## Masonry Layout

Looks even cooler in a grid layout.

<Playground>
{() => {
const perspective = 400
return (
<Grid>
{Array.from(Array(4 * 4).keys()).map(id => (
<div
key={id}
style={{
position: 'relative',
perspective: perspective + 'px',
}}
>
<FollowReveal perspective={perspective}>
<Front>More info</Front>
</FollowReveal>
<div
style={{
background: '#e2e2e2',
width: '100%',
paddingBottom: '100%',
}}
/>
</div>
))}
</Grid>
)
}}
</Playground>
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"esModuleInterop": true,
"jsx": "preserve",
"lib": ["esnext", "dom"],
"module": "esnext",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"strict": true,
Expand Down

0 comments on commit f7e7efe

Please sign in to comment.