no longer any need for setfenv in markdown.lua
steve donovan
10 years ago
117 | 117 | |
118 | 118 | |
119 | 119 | -- Set up a table for holding local functions to avoid polluting the global namespace |
120 | -- Penlight 1.2 defines compatible 5.1 setfenv in utils table | |
120 | 121 | local M = {} |
121 | 122 | local MT = {__index = _G} |
122 | 123 | setmetatable(M, MT) |
123 | if setfenv then setfenv(1, M) end -- if true, we are using LUA 5.1 | |
124 | 124 | |
125 | 125 | ---------------------------------------------------------------------- |
126 | 126 | -- Utility functions |
1133 | 1133 | -- End of module |
1134 | 1134 | ---------------------------------------------------------------------- |
1135 | 1135 | |
1136 | if setfenv then setfenv(1, _G) end | |
1137 | 1136 | M.lock(M) |
1138 | 1137 | |
1139 | 1138 | -- Expose markdown function to the world |