aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilipp A2020-10-31 16:04:19 +0100
committerPhilipp A2020-10-31 16:04:46 +0100
commit89d123ec6586b9d0e48c2f99f11575b254b46e72 (patch)
tree4cd8a9df6c760e1b66d1f5dafbbb20902f019695
parent8252a895ed0d23f23065be5000c45429031a2c6f (diff)
downloadrust-rst-89d123ec6586b9d0e48c2f99f11575b254b46e72.tar.bz2
do the evil thing
-rw-r--r--renderer/src/html/tests.rs22
-rw-r--r--rst/src/main.rs3
2 files changed, 24 insertions, 1 deletions
diff --git a/renderer/src/html/tests.rs b/renderer/src/html/tests.rs
index 5d63fcb..6387238 100644
--- a/renderer/src/html/tests.rs
+++ b/renderer/src/html/tests.rs
@@ -338,6 +338,28 @@ paragraph</p>
");
}
+#[test]
+fn comments() {
+ check_renders_to("\
+.. Run-in
+ comment
+
+..
+
+ block-like
+
+ with blank lines
+", "\
+<!--Run-in
+comment
+-->
+<!--block-like
+
+with blank lines
+-->\
+");
+}
+
/*
#[test]
fn test_field_list() {
diff --git a/rst/src/main.rs b/rst/src/main.rs
index 3c0b8e5..318bcb6 100644
--- a/rst/src/main.rs
+++ b/rst/src/main.rs
@@ -35,7 +35,8 @@ fn main() -> CliResult {
let args = Cli::from_args();
args.verbosity.setup_env_logger("rst")?;
- let content = read_file(args.file)?;
+ // TODO: somehow make it work without replacing tabs
+ let content = read_file(args.file)?.replace('\t', " ".repeat(8).as_ref());
let document = parse(&content)?;
let stdout = std::io::stdout();
match args.format {