cuberite / plugin-repository

Repository for Cuberite plugins
https://plugins.cuberite.org
Other
5 stars 2 forks source link

Support BB-code #6

Closed NiLSPACE closed 8 years ago

NiLSPACE commented 8 years ago

If we'd let the plugin repo support BB code then we could use the output from the InfoDump file directly. It shouldn't be too hard to implement:

function HandleBBCode($a_Text)
{
  $patterns = array(
   '~\[b\](.*?)\[/b\]~',
   '~\[color=(\w*?)\](.*)\[/color\]',
   // Other patterns
  );

  $results = array(
   '<b>$1</b>',
   '<span style="color:$1;">$2</span>',
   // Other results
  );

  return preg_replace($patterns, $results, $a_Text);
}
tigerw commented 8 years ago

The plan is to basically offload everything, including description storage (probably as a README.md), onto GitHub. If this is to happen, it may become necessary for InfoDump to output Markdown since ideally the forum will no longer be the place to store plugins.

NiLSPACE commented 8 years ago

The InfoDump already dumps both BB-code and markdown, so it shouldn't be a problem. Personally I like BB-code more than markdown, so that's why I suggested it here ;)