jeancroy / fuzz-aldrin-plus

Sublime text like fuzzy filtering - compatible with atom/fuzzaldrin
MIT License
269 stars 21 forks source link

Options not being passed #37

Open lukaszsobek opened 6 years ago

lukaszsobek commented 6 years ago

Trying to make the .wrap method produce slightly different tags than default I call:

    const options = {
      tagOpen: '<mark class="highlight">',
      tagClose: "</mark>"
    };

    const html = fuzzyAldrin.wrap(candidateString, query, options);

however the custom tagOpen and tagClose are not being acted on. Is this a bug, or does passing options work differently?

jeancroy commented 6 years ago

Sorry about option documentation. Looking at the source code there seems to be a wrap object that contain all the wrap options.

Technically it was made so all method can feed from the same option object, but I can see how it is confusing.

  const options = {
      wrap: {
             tagOpen: '<mark class="highlight">',
             tagClose: "</mark>"
       }
    };

    const html = fuzzyAldrin.wrap(candidateString, query, options);

I'll consider making "mark" a default as #38

lukaszsobek commented 6 years ago

@jeancroy that would be great!