Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix copy buttons, email filter #68

Merged
merged 2 commits into from
Dec 30, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix copy buttons, email filter
  • Loading branch information
carlosgauci committed Dec 30, 2022
commit 5ee5c45585745597acf9aa369363cec26d624839
2 changes: 1 addition & 1 deletion themes/haystack/assets/js/code-copy-buttons.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
document.addEventListener("DOMContentLoaded", addCopyButtons);

function addCopyButtons() {
document.querySelectorAll("pre > code").forEach(function (codeBlock) {
document.querySelectorAll(".highlight > pre > code").forEach(function (codeBlock) {
const button = document.createElement("button");
button.className = "btn copy-code-button";
button.type = "button";
Expand Down
2 changes: 1 addition & 1 deletion themes/haystack/assets/js/newsletters.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export const newsletters = () => {

if (forms.length > 0) {
// Regex string to validate email
const re = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/;
const re = /^[\w+]+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/;

forms.forEach((form) => {
// Listen to input, validate email, disable/enable submit btn
Expand Down