From a927539e938a2c3f63e1ac5b72f9b364c7ed8777 Mon Sep 17 00:00:00 2001 From: Blerim Sheqa Date: Mon, 26 Nov 2018 11:11:19 +0100 Subject: [PATCH] Fix regex to replace links in index.html --- build-docs.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build-docs.rb b/build-docs.rb index 1957702..b6f7e95 100755 --- a/build-docs.rb +++ b/build-docs.rb @@ -114,8 +114,8 @@ main_pages = build_page_index(full_docs_dir, project_config['project']['docs_dir index_file = "#{clone_target}/index.md" FileUtils.cp("#{clone_target}/#{main_pages[0].values[0]}", index_file) index_content = File.read(index_file) -index_new_content = index_content.gsub(/\(((?!http)\S+(\.md|\.png)(\S+)?)\)/, - "(#{project_config['project']['docs_dir']}/\\1)") +index_new_content = index_content.gsub(/\(((?!http)\S+(\.md|\.png)(\w)?)/, + "(#{project_config['project']['docs_dir']}/\\1") File.open(index_file, "w") {|file| file.puts index_new_content } mkdocs['pages'].push('' => "index.md")