Giter Site home page Giter Site logo

nicolassiver / nodebb-plugin-ns-spoiler Goto Github PK

View Code? Open in Web Editor NEW
12.0 12.0 19.0 133 KB

Spoiler. Ability to control visibility of the content in posts. Works better with Markdown syntax.

License: MIT License

JavaScript 97.29% Less 2.71%
lazy-loading nodebb plugin spoiler

nodebb-plugin-ns-spoiler's People

Contributors

barisusakli avatar dependabot[bot] avatar julianlam avatar nicolassiver avatar tfriedlander avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

nodebb-plugin-ns-spoiler's Issues

Nodebb compatibility

Hey, it seems that plugin is not compatible with newest nodebb. I'm not sure if this can be fixed quickly though.

Button not workin

Hi i install plugin at 1.12.2 and not work when i press button :(

Can't get spoiler content in production env

https://github.com/NicolasSiver/nodebb-plugin-ns-spoiler/blob/master/plugin/controller.js
line 17-18

// Trigger parsing process, it will invoke `Controller.parsePost` through hooks
async.apply(nodebb.posts.parsePost),

this would not trigger parsing process when global.env === 'production', because cache was used in https://github.com/NodeBB/NodeBB/blob/45e412ed7c0a876da177a491c1f03f4623349936/src/posts/parse.js line18-21

if (postData.pid && cache.has(String(postData.pid))) {
	postData.content = cache.get(String(postData.pid));
	return callback(null, postData);
}

so you would never get the spoiler content.

Lists

If spoiler is used with lists, without additional space, it creates broken layout.

Issue with multiple lists

We have discovered that more complex posts with multiple lists and spoilers can have a race condition. Where spoiler will move content around from one list under a spoiler to another list.

Example content is mentioned here: #13 (comment)

Images dont show up

Hi!

Images in spoiler dont show up. I would be grateful for help.

Nodebb version: v1.8.2

Link to Nodebb community topic: https://community.nodebb.org/topic/12246/fix-spoiler-plugin

Error in console:

spoiler.js:57 Uncaught TypeError: e.unloadImages is not a function
    at i.<anonymous> (spoiler.js:57)
    at i.onack (socket.io.js:2)
    at i.onpacket (socket.io.js:2)
    at i.<anonymous> (socket.io.js:2)
    at i.emit (socket.io.js:1)
    at i.ondecoded (socket.io.js:1)
    at a.<anonymous> (socket.io.js:2)
    at a.i.emit (socket.io.js:1)
    at a.add (socket.io.js:1)
    at i.ondata (socket.io.js:1)

Doesn't work with v1.12.0

Unfortunately, this plugin doesn't work with NodeBB v1.12.0.

The only error that's given:

2019-03-25T19:04:32.319Z [4567/11403] - �[33mwarn�[39m: [plugins/load] The following plugins may not be compatible with your version of NodeBB. This may cause unintended behaviour or crashing. In the event of an unresponsive NodeBB caused by this plugin, run `./nodebb reset -p PLUGINNAME` to disable it.
�[33m  * �[39mnodebb-plugin-ns-spoiler

Spoilers having problems with lists

I tried to use lists with spoilers and that broke things.

:::

1. Item
2. Item 

:::

Expected behavior:

Everything between the spoiler tags being hidden

What actually happens:

List gets displayed, button below.

Support for NodeBB 1.13.x / 1.14.x ?

Hi there,

I am running a NodeBB on 1.13.3. When installing your plugin the plugin finder only gives me version 4.1.0, which does not work. I assume the latest doesn't show up due to package.json compatibility being ~1.12.0 (and that older version maybe didn't have the correct compatibility settings).

If this plugin is compatible with 1.13.x and/or 1.14.x I'd love to see an update in the package.json and a new npm release ❤️

Thanks a lot in advance.

Adding a double quote before spoiler doesn't let spoiler to open

I use [email protected] with NodeBB 1.15.5.
Generally everything works good. But once I add some text with double quotes, a spoiler located after such text stops to open.

Examples of NodeBB post for which spoiler doesn't open:

Text "text" text

:::

something

:::

Text "text

:::

something

:::

Example of NodeBB post for which spoiler works well:
Text text

:::

something

:::

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.