andymantell / node-wpautop

A Node.js port of Wordpress' wpautop() function
GNU General Public License v2.0
16 stars 7 forks source link

How to use? Import not working #6

Closed Loosie94 closed 1 year ago

Loosie94 commented 1 year ago

Hi, I was looking for exactly this function! I know this repo is a bit old, but this is what I need. But somehow I can't make this work in a Nuxt 3 (Vue.js) Nuxt envirionment.

I use: import { wpautop } from "wp {{ wpautop('test') }}

Any idea what I'm doing wrong? Thanks!

Loosie94 commented 1 year ago

Got this working with: import wpautop from "wpautop/lib/wpautop.js"; Thanks!

andymantell commented 1 year ago

Glad you got it working! Not sure why it didn't work like that without digging into it, but I think when I wrote it no-one was using import - I only ever tried require with this library.

Might be worth checking whether wordpress has made changes since this library was released though? It's nearly 10 years old!