From 11111bb49889feb1b00e6814d9d81e3e23409d7c Mon Sep 17 00:00:00 2001
From: Huynh Tan <danhuynhdev@gmail.com>
Date: Thu, 30 Jun 2022 15:52:03 +0700
Subject: Read useInheritance from emacs config

---
 util/processOrg.tsx | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

(limited to 'util/processOrg.tsx')

diff --git a/util/processOrg.tsx b/util/processOrg.tsx
index 611c039..ea868ee 100644
--- a/util/processOrg.tsx
+++ b/util/processOrg.tsx
@@ -50,6 +50,7 @@ export interface ProcessedOrgProps {
   linksByNodeId: LinksByNodeId
   macros: { [key: string]: string } | {}
   attachDir: string
+  useInheritance: boolean
 }
 
 export const ProcessedOrg = (props: ProcessedOrgProps) => {
@@ -66,6 +67,7 @@ export const ProcessedOrg = (props: ProcessedOrgProps) => {
     linksByNodeId,
     macros,
     attachDir,
+    useInheritance,
   } = props
 
   if (!previewNode || !linksByNodeId) {
@@ -77,7 +79,7 @@ export const ProcessedOrg = (props: ProcessedOrgProps) => {
     .use(extractKeywords)
     .use(attachments, {
       idDir: attachDir || undefined,
-      useInheritance: true,
+      useInheritance,
     })
     .use(uniorgSlug)
     .use(uniorg2rehype, { useSections: true })
@@ -157,6 +159,7 @@ export const ProcessedOrg = (props: ProcessedOrgProps) => {
                   isWiki={isMarkdown}
                   macros={macros}
                   attachDir={attachDir}
+                  useInheritance={useInheritance}
                 >
                   {children}
                 </PreviewLink>
-- 
cgit v1.2.3

