Giter VIP home page Giter VIP logo

bugle's People

Contributors

vstojkovic avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

lucasportella

bugle's Issues

BBScope badness

Hey, I hope you don't mind me bothering you with this. I noticed that you had to jump through a lot of hoops to get the BBScope bbcode parser to work for you; namely that you had to insert "img" into the only list to get images to work inside links (oof I'm sorry you had to do that) at

static ref BBCODE: BBCode = {
use bbscope::MatchType;
let mut matchers = BBCode::basics().unwrap();
matchers.append(&mut BBCode::extras().unwrap());
for matcher in matchers.iter_mut() {
if matcher.id == "url" {
if let MatchType::Open(ref mut info) = matcher.match_type {
if let Some(ref mut only) = Arc::get_mut(info).unwrap().only {
only.push("img");
}
}
}
}
BBCode::from_matchers(matchers)
};
and then needing to replace newlines with <br> at
html = html.replace("\n", "<br>");

I'm sorry you had so many issues; I didn't expect anyone to use this. I made an update which should make all this much easier, and fix a couple issues. First, since you're using the extended tagset, tags that render to <pre> (like [code]) will break if you replace all newlines with <br>. Second, if the bbcode you're parsing accidentally doesn't provide a url when embedding an image, such as [url][img=whatever][/url], it will generate incorrect HTML (or so it seems). Both of these are my fault of course.

I believe both of these are fixed in 0.2.0, so if you're willing, you could update bbscope to 0.2.0 in Cargo.toml then change your BBCode initialization to just:

//Images are allowed inside url scope by default now and handle the situation when no url is provided (it's not pretty but it's 
//not invalid html at least). Furthermore, the default is to emit <br> where appropriate (so not within pre, img, etc)
static ref BBCODE: BBCode = BBCode::from_config(BBCodeTagConfig::extended(), None).unwrap();

So you don't have to loop over stuff or merge separate matchers, etc. There's some other configuration stuff inside the BBCodeTagConfig if you need, and I can add more as needed.

Then, you can remove the newline replacement mentioned above, as newlines are now conditionally replaced with <br> when in the correct scope.

Anyway, I hope that wasn't bothersome, feel free to ignore :^). Just figured I'd mention since it sucks having to make hacks for libraries (and I don't want you to be surprised by incorrect html generation).

BUGLE doesn´t start after AoW Chapter 3

Hi, since the last update from FC Bugle is not starting anymore, the following error occurs:

Dec 16 13:07:58.739 ERRO Error with Conan Exiles installation, error: missing field name at line 1 column 2400

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.