Comments (5)
@ndaidong Awesome thanks a lot! Now code blocks are formatted properly.
Thanks once again!
from article-extractor.
@victory-sokolov nice to see it works for you.
from article-extractor.
@victory-sokolov thank you for your idea. Could you explain more detail and suggest some links to test? I consider that if that is a specific case, we can simply use transformation.
from article-extractor.
Not sure if it will be straightforward to implement it using custom transformation.
Here is an example of the extracted code block
import { useTheme } from 'next-themes'; const ThemeChanger = () => { const { theme, setTheme } = useTheme(); return ( <div> The current theme is: {theme} <button onClick={() => setTheme('light')}>Light Mode</button> <button onClick={() => setTheme('dark')}>Dark Mode</button> </div> ); };
and this is the original code copied from the dev console (site)
import { useTheme } from 'next-themes';
const ThemeChanger = () => {
const { theme, setTheme } = useTheme();
return (
<div>
The current theme is: {theme}
<button onClick={() => setTheme('light')}>Light Mode</button>
<button onClick={() => setTheme('dark')}>Dark Mode</button>
</div>
);
};
In general code, blocks have 4 spaces for nested blocks, but when an article is being scrapped it has only one, I guess this is because of the stripMultispaces
. Maybe you have other ideas how those spaces can be preserved
Thanks in advance.
from article-extractor.
@victory-sokolov yeah, you are right. It's because of stripMultispaces
. Let me see how we can make it as a configurable option.
from article-extractor.
Related Issues (20)
- Can't run the lib with J
- Can't run using JEST HOT 3
- Some url do not work HOT 2
- Error [ERR_REQUIRE_ESM]: require() of ES Module >=8.0.2 HOT 3
- Incorrect resolution when there are multiple Open Graph tags HOT 3
- Node example works but deno don't on a specific site HOT 2
- Can i use with utf 8 ? HOT 1
- Specific site work with deno but not node HOT 7
- Feat: extract pagetype from og:type or ld+json HOT 3
- Encountering errors while using library inside NodeJS + TS project HOT 4
- Expected ',' or '}' after property value in JSON at position 543 (line 23 column 7) HOT 4
- Crashes on Pinterest and a lot of other websites HOT 16
- @extractus/article-extractor 8.0.6 isn't compatible with Google Cloud Functions HOT 5
- Encoding windows-1250 not properly decoded! HOT 4
- img tag with "data" protocol was removed when doing purify HOT 3
- Using Playwright or Pupperteer do not work for me with extractFromHtml() HOT 1
- Is it possible to enable the Require() Import ? HOT 5
- Not getting any data when extracting from https://zenn.dev/ while if i use Mozilla reader mode, i am getting data.
- extractFromHtml just returns `null`. HOT 6
- `extractFromHtml` missed an `<h1>` in the `content` json result. 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 article-extractor.