fuzz-aldrin-plus icon indicating copy to clipboard operation
fuzz-aldrin-plus copied to clipboard

Options not being passed

Open lukaszsobek opened this issue 7 years ago • 2 comments

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?

lukaszsobek avatar Mar 07 '18 06:03 lukaszsobek

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

jeancroy avatar Mar 07 '18 14:03 jeancroy

@jeancroy that would be great!

lukaszsobek avatar Mar 08 '18 16:03 lukaszsobek