diff options
Diffstat (limited to 'src/Text')
-rw-r--r-- | src/Text/Pandoc/Readers/Org.hs | 7 | ||||
-rw-r--r-- | src/Text/Pandoc/Writers/Org.hs | 4 |
2 files changed, 6 insertions, 5 deletions
diff --git a/src/Text/Pandoc/Readers/Org.hs b/src/Text/Pandoc/Readers/Org.hs index d7939c95a..0ccaa8782 100644 --- a/src/Text/Pandoc/Readers/Org.hs +++ b/src/Text/Pandoc/Readers/Org.hs @@ -626,9 +626,10 @@ propertiesDrawer = try $ do keyValuesToAttr :: [(String, String)] -> Attr keyValuesToAttr kvs = let - id' = fromMaybe mempty . lookup "id" $ kvs - cls = fromMaybe mempty . lookup "class" $ kvs - kvs' = filter (flip notElem ["id", "class"] . fst) kvs + lowerKvs = map (\(k, v) -> (map toLower k, v)) kvs + id' = fromMaybe mempty . lookup "custom_id" $ lowerKvs + cls = fromMaybe mempty . lookup "class" $ lowerKvs + kvs' = filter (flip notElem ["custom_id", "class"] . fst) lowerKvs in (id', words cls, kvs') diff --git a/src/Text/Pandoc/Writers/Org.hs b/src/Text/Pandoc/Writers/Org.hs index bc400c998..e2196dcc7 100644 --- a/src/Text/Pandoc/Writers/Org.hs +++ b/src/Text/Pandoc/Writers/Org.hs @@ -239,8 +239,8 @@ propertiesDrawer (ident, classes, kv) = let drawerStart = text ":PROPERTIES:" drawerEnd = text ":END:" - kv' = if (classes == mempty) then kv else ("class", unwords classes):kv - kv'' = if (ident == mempty) then kv' else ("id", ident):kv' + kv' = if (classes == mempty) then kv else ("CLASS", unwords classes):kv + kv'' = if (ident == mempty) then kv' else ("CUSTOM_ID", ident):kv' properties = vcat $ map kvToOrgProperty kv'' in drawerStart <> cr <> properties <> cr <> drawerEnd |