Comments (5)
@maxime1992 ok I've come up with a fix, it's somewhat simple as it just checks if the diff would be trailing whitespace only. Note that you have to be careful that prettier also runs on all your source files as the embedded snippets are also run through prettier. This caught me out as I was running yarn run prettier "**/*.{js,json,json5,scss,md,ts,html}"
with yaml omitted, but the yaml embed in the fixture was being rewritten, causing a diff and the tests to fail.
from embedme.
I also just notice that it's an issue when running prettier as:
- prettier adds an empty line at the end of a file (which can be the demo code used by embedme)
- embedme doesn't trim the code when injecting it
- prettier runs on CI and throws an errors as it wants to remove the last empty line on the code block
from embedme.
This issue is oddly complex - prettier's behavior differs depending on the detected code type of the code block. I'll have a think
from embedme.
π This issue has been resolved in version 1.9.0 π
The release is available on:
Your semantic-release bot π¦π
from embedme.
Nice one π I'll give a try asap :)
from embedme.
Related Issues (20)
- Something Wrong a comment start with // in code block HOT 2
- Consider using node-glob instead of shell expansion HOT 5
- Comments are not detected when CRLF is used instead of LF HOT 4
- Add -w βwatch mode HOT 2
- sql is in the list - but it says it's not support HOT 3
- Add support for haskell
- [Feature Request] Support start and end tags for embedding snippets of code HOT 7
- Request: Support for .ino files (Arduino sketches) HOT 2
- Add contribution guidelines
- [Request] add support for .tsx files HOT 2
- Include code from a public github repo? HOT 9
- Allow regex parsing of files HOT 1
- Support including snippets of files HOT 3
- When the file trying to embed starts with 2 white spaces it won't embed the content
- Additional supported file type
- allow single lines (#L1 instead of #L1-L1)
- Additional file extension supported: Dockerfile
- Language extension with metadata isn't parsed correctly
- Return error code when file is renamed or moved HOT 2
- No comment detected in first line for block with extension HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from embedme.