Index: /pyyaml/trunk/tests/data/emit-block-scalar-in-simple-key-context-bug.canonical
===================================================================
--- /pyyaml/trunk/tests/data/emit-block-scalar-in-simple-key-context-bug.canonical	(revision 218)
+++ /pyyaml/trunk/tests/data/emit-block-scalar-in-simple-key-context-bug.canonical	(revision 218)
@@ -0,0 +1,6 @@
+%YAML 1.1
+--- !!map
+{
+  ? !!str "foo"
+  : !!str "bar"
+}
Index: /pyyaml/trunk/tests/data/emit-block-scalar-in-simple-key-context-bug.data
===================================================================
--- /pyyaml/trunk/tests/data/emit-block-scalar-in-simple-key-context-bug.data	(revision 218)
+++ /pyyaml/trunk/tests/data/emit-block-scalar-in-simple-key-context-bug.data	(revision 218)
@@ -0,0 +1,4 @@
+? |-
+  foo
+: |-
+  bar
Index: /pyyaml/trunk/lib/yaml/emitter.py
===================================================================
--- /pyyaml/trunk/lib/yaml/emitter.py	(revision 197)
+++ /pyyaml/trunk/lib/yaml/emitter.py	(revision 218)
@@ -493,5 +493,6 @@
                 return ''
         if self.event.style and self.event.style in '|>':
-            if not self.flow_level and self.analysis.allow_block:
+            if (not self.flow_level and not self.simple_key_context
+                    and self.analysis.allow_block):
                 return self.event.style
         if not self.event.style or self.event.style == '\'':
@@ -671,5 +672,5 @@
             if index == 0:
                 # Leading indicators are special characters.
-                if ch in u'#,[]{}#&*!|>\'\"%@`': 
+                if ch in u'#,[]{}&*!|>\'\"%@`': 
                     flow_indicators = True
                     block_indicators = True
