Browse Source

fixed regexes, added shortcode regex

main
gryffyn 11 months ago
parent
commit
79b7254684
Signed by: gryffyn GPG Key ID: 6948DD6514D02BEF
  1. 2
      .gitignore
  2. 8
      .idea/.gitignore
  3. 9
      .idea/md2gm.iml
  4. 11
      .idea/misc.xml
  5. 8
      .idea/modules.xml
  6. 6
      .idea/vcs.xml
  7. 2
      md2gm.go

2
.gitignore

@ -20,6 +20,7 @@
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml
.idea/discord.xml
# Gradle
.idea/**/gradle.xml
@ -88,3 +89,4 @@ fabric.properties
# Dependency directories (remove the comment below to include it)
# vendor/
go.sum

8
.idea/.gitignore

@ -0,0 +1,8 @@
# Default ignored files
/shelf/
/workspace.xml
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml
# Editor-based HTTP Client requests
/httpRequests/

9
.idea/md2gm.iml

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="Go" enabled="true" />
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

11
.idea/misc.xml

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CMakeSettings">
<configurations>
<configuration PROFILE_NAME="Debug" CONFIG_NAME="Debug" />
</configurations>
</component>
<component name="GitToolBoxStore">
<option name="projectConfigVersion" value="2" />
</component>
</project>

8
.idea/modules.xml

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/md2gm.iml" filepath="$PROJECT_DIR$/.idea/md2gm.iml" />
</modules>
</component>
</project>

6
.idea/vcs.xml

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

2
md2gm.go

@ -33,11 +33,13 @@ func md2gm(c *cli.Context) error {
reg_link := regexp.MustCompile(`\[(?P<name>.+?)\]\((?P<url>.+?)\)`)
reg_cite := regexp.MustCompile(`\[\^.+?\]\(.+?\)`)
reg_hugo := regexp.MustCompile(`(?s)\+{3}.+?\+{3}`)
reg_shcd := regexp.MustCompile(`{{(.*<.*>.*|.*%.*%.*)}}\n?`)
// deletes hugo and html tags
gm := reg_html.ReplaceAllString(md, "${1}")
gm = reg_hugo.ReplaceAllString(gm, "${1}")
gm = reg_cite.ReplaceAllString(gm, "${1}")
gm = reg_shcd.ReplaceAllString(gm, "${1}")
// redoes links
reg_link_matches := reg_link.FindStringSubmatch("[Mosh](https://mosh.org)")

Loading…
Cancel
Save