Skip to content

Commit

Permalink
🐛 fix CI error and add character spacing to label
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick Tilden committed Nov 14, 2016
1 parent 8a8f4a8 commit b7a3f10
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/form/html.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,15 @@ const addRequired = (html, input, index) => {

// regex to search for `for`
const reFor = new RegExp(`(${stringFor})`);
render = render.replace(reFor, `for="${inp.id}"`);

// add required to input
const reName = new RegExp(`name=['"]\\s*${inp.name}\\s*['"]`);
render = render.replace(reName, `name="${inp.name}" aria-required="true" required`);

// Add required text to label
const reLabel = new RegExp('</label>');
render = render.replace(reLabel, `<mark class="${level}">required to ${required}</mark></label>`);
render = render.replace(reLabel, `\s<mark class="${level}">required to ${required}</mark></label>`);
}
});

Expand Down

0 comments on commit b7a3f10

Please sign in to comment.