Skip to content

Commit

Permalink
alte comment nodes raus
Browse files Browse the repository at this point in the history
  • Loading branch information
bskp committed Sep 10, 2023
1 parent e1ce755 commit 06c3305
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
6 changes: 6 additions & 0 deletions app/client/rezepte.less
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,11 @@ body {
cursor: default;
}

blockquote {
margin-left: inherit;
font-style: italic;
}

h1 {
font-family: three_line_pica;
font-weight: normal;
Expand All @@ -482,6 +487,7 @@ h1 {
text-align: left;
margin-left: -0.05rem;
letter-spacing: -2pt;
white-space: nowrap;

&::before {
content: 'n';
Expand Down
1 change: 0 additions & 1 deletion app/imports/api/mdast-recipe-builders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,3 @@ export const quantityNode = (value: string) => valueNode("quantity", value);
export const unitNode = (value: string) => valueNode("unit", value);
export const ingredientNode = (value: string) => valueNode("ingredient", value);
export const tagNode = (value: string) => valueNode("tag", value);
export const commentNode = (value: string) => valueNode("comment", value);
4 changes: 1 addition & 3 deletions app/imports/api/remark-recipe.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {map} from "unist-util-map";
import {is} from "unist-util-is";
import {commentNode, ingredientListNode, tagNode} from "./mdast-recipe-builders";
import {ingredientListNode, tagNode} from "./mdast-recipe-builders";
import {listItem} from "mdast-builder";
import {splitIngredients} from "./mdast-recipe";
import type {Plugin, Transformer} from 'unified'
Expand Down Expand Up @@ -34,8 +34,6 @@ const remarkRecipe: Plugin = function () {
tags.push(tagNode(match[1]) as PhrasingContent)
}
return tags
} else if (text.value.match(/~ ?\w*\s*$/)) {
return commentNode(text.value) as PhrasingContent
}
return child
});
Expand Down
9 changes: 2 additions & 7 deletions app/imports/ui/recipe-schema.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,6 @@ const paragraphRule = {
matchMdast: matchType('tag'),
component: () => ""
},
{
matchMdast: matchType('comment'),
props: node => ({value: node.value}),
component: ({value}) => <em>{value}</em>
},
{
matchMdast: matchType('link'),
props: node => ({
Expand Down Expand Up @@ -107,7 +102,7 @@ const schema = {
listRule,
{
matchMdast: matchType('blockquote'),
component: ({children}) => <em>{children}</em>,
component: ({children}) => <blockquote>{children}</blockquote>,
},
{
matchMdast: matchType("ingredientList"),
Expand Down Expand Up @@ -147,7 +142,7 @@ const schema = {

function IngredientItem(props: { children }) {
const ref = useRef<HTMLLIElement>(null)
const clickHandler: React.MouseEventHandler = event => {
const clickHandler: React.MouseEventHandler = () => {
const quantityNode = ref?.current?.querySelector('.quantity');
if (quantityNode) { // @ts-ignore
quantityNode.click()
Expand Down

0 comments on commit 06c3305

Please sign in to comment.